Get the latest tech news

In React {Transitions} = F(state)


Thinking about the React component tree as modeling a state machine can help clarify the implications of asynchronous updates and React’s concurrent features.

Some of React’s concurrent mode features, for example startTransition, allow you to perform state updates which intentionally do not flush to the DOM before yielding to the user. {transitions} = f(state) is a useful mental model for thinking about how your application guards against letting users trigger invalid updates. Thanks to Evan Yeung for the conversations which lead to this observation and to Joe Savona, Jordan Brown, Jack Pope and Rick Hanlon for reading early drafts of this post.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of transitions

transitions

Photo of React

React

Related news:

News photo

Show HN: Make SVGs interactive in React with 1 line

News photo

Konva.js - Declarative 2D Canvas for React, Vue, and Svelte

News photo

Everything about Google Translate crashing React (and other web apps)