Writing custom hooks in React
· 4 min read
Hooks came into play in React 16.8, they allow you to manage state and side effects in functional components.
The default React hooks are pretty useful, but sometimes you’ll find yourself repeating the same logic, we can extract this into a custom hook and reuse it.