This blog assumes that you know the fundamentals of react like Component, Props and jsx. We will not go into the depths of this but re-rendering actually works in React, so you need to understand how this works in short. In our Counter component 0 is the initial value for the state, and using destructuring we are naming our 2 variables counter and setCounter. setCounter is used to update the counter value by 1 every time the button is clicked.

4m read timeFrom shubhs.hashnode.dev
Post cover image
Table of contents
What is a state and why do we need state management in React? ⚛️useState Hook 🎣
1 Comment

Sort: