revirth / what-is-hooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hooks

useState returns a stateful value, and a function to update it

useEffect will run after the render is committed to the screen

useContext accepts a context object (the value returned from React.createContext) and returns the current context value for that context

useReducer accepts a reducer of type (state, action) => newState, and returns the current state paired with a dispatch method

useMemo will only recompute the memoized value when one of the dependencies has changed

useCallback will return a memoized version of the callback that only changes if one of the dependencies has changed

refs

About


Languages

Language:JavaScript 61.4%Language:TypeScript 15.3%Language:HTML 15.1%Language:CSS 8.3%