From the course: React: State Management (2019)

Unlock the full course today

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

Avoid prematurely adding state management packages

Avoid prematurely adding state management packages - React.js Tutorial

From the course: React: State Management (2019)

Start my 1-month free trial

Avoid prematurely adding state management packages

- [Instructor] Let's talk about why we need state management. As soon as you extend beyond basic functionality, there's typically some need for a state management solution. As you begin to manage large amounts of data, it can become pretty unwieldy. The main reason to use a state management solution is that it manages business logic. Well, what do I mean by that? Let's start with the distinction between presentation and business logic. Presentation logic refers to logic that's associated with how components appear on a page. For example, when should a modal dialog pop up? Does the color of a button change when a user hovers over it? Another way to think about it is, think of logic that's agnostic towards the application's purpose. On the other hand, we have business logic, which refers to handling, manipulating, and storing business objects. So for example, in a to-do app where we have a user that needs to log in, it could mean things like user accounts or items in a to-do list…

Contents