Image for post
Image for post

My object here isn’t explain how each hook works, my object is explain how use hook to get best performance and some tricks that I learned with life. I ever search how is the right way to use the hooks and it is very hard to find the answers so I decided share this knowledge.

All React codes are functions, their has life cycle, when the component render all variables (except hooks) are recreate so if you need to keep a value you need to use “useState” for it, look next code:

About

Everton Menezes

Another lover for coding

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