How do you handle state in React?

Local state is perhaps the easiest kind of state to manage in React, considering there are so many tools built into the core React library for managing it. useState is the first tool you should reach for to manage state in your components . It can take accept any valid data value, including primitive and object values.

Read more

Should I use state or props React?

props are a way of passing data from parent to child. If you’re familiar with the concept of state, don’t use state at all to build this static version . State is reserved only for interactivity, that is, data that changes over time. Since this is a static version of the app, you don’t need it.

Read more