Category: state

Managing State in React With Unstated

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 ...

Understanding React `setState`

React components can, and often do, have state. State can be anything, but think of things like whether a user is logged in or not and displaying the correct username based on which account is active. Or an array of blog posts. Or if a modal is open or not and which tab within it is active. React components with state ...

Working with Data in React: Properties & State

This article is part of a web development series from Microsoft. Thank you for supporting the partners who make SitePoint possible. Managing data is essential to any application. Orchestrating the flow of data through the user interface (UI) of an application can be challenging. Often, today’s web applications have c...

User Facing State

Let’s talk about state. Communicating state to the user that is, not application stores state in JavaScript objects, or localStorage. We’re going to be talking about how to let our users know about state (think: whether a button is disabled or not, or if a panel is active or not), and how we can use CSS for...

Intro to Vue.js: Vuex

This is the fourth part in a five-part series about the JavaScript framework, Vue.js. In this part, we’ll cover Vuex for state management. This is not intended to be a complete guide, but rather an overview of the basics to get you up and running so you can get to know Vue.js and understand what the framework has...

How to Manage Your JavaScript Application State with MobX

If you’ve ever written anything more than a very simple app with jQuery, you’ve probably run into the problem of keeping different parts of the UI synchronized. Often, changes to the data need to be reflected in multiple locations, and as the app grows you can find yourself tied in knots. To tame the madnes...

React for Angular Developers

This article is for developers who are familiar with Angular 1.x and would like to learn more about React. We’ll look at the different approaches they take to building rich web applications, the overlapping functionality and the gaps that React doesn’t attempt to fill. After reading, you’ll have an un...

What’s in a State and How to Persist It

A state is something that is affected by you and the memory of that. This something can be you clicking on an element, like a button, or you typing some text into an element. The state resides in your browser’s RAM. It deals with JavaScript objects like arrays, strings, objects, and so on. In this article we’re goi...