Web / ReactJS Interview questions
Difference between using "useState" hook and just a variable in React.
useState rerenders the view. Variables by themselves only change in memory and the state of your app can get out of sync with the view.
use "useState" hook to store the state if that state needs to be sync/utilized in the rendered view. For all other needs, utilize variables.
More Related questions...