{"id":270954,"date":"2018-05-29T07:04:29","date_gmt":"2018-05-29T14:04:29","guid":{"rendered":"http:\/\/css-tricks.com\/?p=270954"},"modified":"2018-05-29T07:04:29","modified_gmt":"2018-05-29T14:04:29","slug":"managing-state-in-react-with-unstated","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/managing-state-in-react-with-unstated\/","title":{"rendered":"Managing State in React With Unstated"},"content":{"rendered":"

As your application becomes more complex, the management of state can become tedious. A component’s state is meant to be self-contained, which makes sharing state across multiple components a headache. Redux is usually the go-to library to manage state in React, however, depending on how complex your application is, you might not need Redux<\/a>.<\/p>\n

Unstated<\/a> is an alternative that provides you with the functionality to manage state across multiple components with a Container class and Provider and Subscribe components. Let’s see Unstated in action by creating a simple counter and then look at a more advanced to-do application.<\/p>\n

<\/p>\n

Using Unstated to Create a Counter<\/h3>\n