An Introduction to React Hooks
React Hooks let you use state and other React features without writing a class. The most common hooks are useState
and useEffect
.
Example: useState
const [count, setCount] = useState(0)
Example: useEffect
useEffect(() => {
// side effect here
}, [])
Hooks make your components simpler and more powerful!