Using the State Hook in React Native or JS

Hooks are another expansion in React 16.8. They let you use state and other React highlights without composing a class.

What is a Hook?

A Hook is a unique capacity that lets you “guide into” React highlights. For instance, useState is a Hook that lets you add React state to work segments. you can learn different Hooks clicking this https://reactjs.org/docs/hooks-intro.html.

When would you use a Hook? 
In the event that you compose a capacity segment and acknowledge you have to add some state to it, already you needed to change over it to a class. Presently you can utilize a Hook inside the current capacity segment. We will do that at the present time!

Leave a Reply

Your email address will not be published. Required fields are marked *