From the course: React: State Management (2019)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

The power of setState()

The power of setState() - React.js Tutorial

From the course: React: State Management (2019)

Start my 1-month free trial

The power of setState()

- [Instructor] If you've used React before, it's pretty likely you've used state. It's what allows you to keep track of changing variables in your application that determine how your component renders behaves. That's a lot, so let's dig deeper into what React state can accomplish, and why you would want to use a pure React solution instead of introducing an external state management library such as Redux. What's confusing about the React world, is that we've overloaded the word state. We use it to mean both component and application state. I'll clarify which kind of state I'm talking about by using React state when talking about component state, and I'll say Redux state when talking about application state. Before we get started talking about React state, I recommend reading Dan Abramov's post on why you might not need Redux. It's not about Redux as much as it is about the power of React state. In particular, he points out that we already have a very powerful tool in React to do…

Contents