Supporting Multiple States

Learn about how to handle multiple states individually and simultaneously in the React application.

Sustain multiple states

Let's see whether we can support multiple states instead of one state.

It's great that we can establish a persistent state within a function component. However, we want more states like that. An app normally contains lots of buttons, switches, and actionable items; each requires a persistent state. So, it's a must-have to support multiple states in the same app.

So, say we need two buttons, and each needs to be driven by a state. Let's extend what we have learned from a single state:

Get hands-on with 1400+ tech skills courses.