reading-notes
Project maintained by mr-atta
Hosted on GitHub Pages — Theme by mattgraham
Hook
<hr>
Review, Research, and Discussion
How does React differ from vanilla JS/HTML/CSS❓ 📁
-
React breaks down the UI into smaller and reusable components that can move around data amongst each other.
-
Vanilla JS initially renders the UI anywhere from 5-10x faster than Preact, and about 30x faster than React!
What is the primary difference between a function component and a class component❓ 📁
hooks vs class
Why Hooks?
- However, we often can’t break complex components down any further because the logic is stateful and can’t be extracted to a function or another component.
very common ases:
- Huge components that are hard to refactor and test.
- Duplicated logic between different components and lifecycle methods.
- Complex patterns like render props and higher-order components.
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.
Basic Hooks
- useState
- useEffect
- useContext
Additional Hooks
- useReducer
- useCallback
- useMemo
- useRef
- useImperativeHandle
- useLayoutEffect
- useDebugValue
📁making sense of hooks
📁the state hook
📁hooks api
📁hooks api reference