revirth/what-is-hooks

★ 1Forks 0JavaScriptGitHub ↗Compare

README

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

Contributors

revirth

Issues