You can create your own hooks to encapsulate component logic into functions that can be reused.

Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class

If you are reading this article then most likely you have already used React Hooks. You probably used the good old reliable useState hook for basic setting and getting of local state in a functional component. And you may have also used the powerful useEffect hook to generate side effects after every render!

Your goal now surely is to further leverage the power of hooks by creating your very own custom hooks. …

Tariq Abdullah

Frontend Software Engineer at Publicis Sapient

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store