One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| #!/bin/sh | |
| STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
| ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint" | |
| if [[ "$STAGED_FILES" = "" ]]; then | |
| exit 0 | |
| fi | |
| PASS=true |
| import React, { useState, useCallback } from 'react'; | |
| import Button from './Button'; | |
| const Example = () => { | |
| const [count, setCount] = useState(0); | |
| const increment = useCallback(() => { | |
| setCount(c => c + 1); | |
| }, [setCount]); |
| import React, { useContext } from 'react'; | |
| const currentPath = React.createContext({ path: '/welcome' }); | |
| const goNext = React.createContext(true); | |
| const isLogin = React.createContext(false); | |
| const Section = () => { | |
| const path = useContext(currentPath); | |
| return ( |
| const useColor = (color) => { | |
| useEffect(() => { | |
| document.title = color; | |
| }, [color]); | |
| }; | |
| const Section = () => { | |
| const [color, setColor] = useState("red"); | |
| const handleSelectColor = (e) => { |
| render() { | |
| return ( | |
| <React.Fragment> | |
| <ChildA /> | |
| <ChildB /> | |
| <ChildC /> | |
| </React.Fragment> | |
| ); | |
| } |
| const ProfileComponent = React.lazy(() => import('./ProfileComponent')); | |
| const PortfolioComponent = React.lazy(() => import('./PortfolioComponent')); | |
| function InfoComponent() { | |
| return ( | |
| <div> | |
| <Suspense fallback={<div>Loading...</div>}> | |
| <section> | |
| <ProfileComponent /> | |
| <PortfolioComponent /> |
| import React, { useState } from 'react'; | |
| function MyComponent(props) { | |
| return ( | |
| <div> | |
| <p>Name: {props.input.name}</p> | |
| </div> | |
| ) | |
| } |
| import React from 'react'; | |
| class PureComponent extends React.PureComponent { | |
| render() { | |
| return ( | |
| <div> | |
| <p>Name: {this.props.input.name}</p> | |
| </div> | |
| ); | |
| } |