useState() Hook in React - A Complete Guide | Hygraph
Learn everything you need to know about the useState() hook, how it works, and some rules that guide how it works alongside examples for better understanding.
hygraph.com
React Hooks - GeeksforGeeks
Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
geeksforgeeks.org
State
What is “State” in React?
State = memory of a component
whenever an interaction happens, component need to change and show the latest data after an interaction
It stores values that can change over time and should be shown in the UI.
To update the UI, components first need to “remember” these things: the current input value, the current page, and the current contact list
Local variables do not trigger re-renders,React would not detect a state change and would not re-render our…