tearing
A visual glitch in which different parts of the screen show different versions of the same data at the same time.
In more detail
It can happen with concurrent rendering if an outside store changes while React has paused part way through a render. useSyncExternalStore prevents it by forcing a consistent snapshot, and React commits DOM changes all at once for the same reason.
Related terms
- useSyncExternalStore — The React hook for reading data from a store outside React, such as a state library or a browser API, without tearing.
- concurrent rendering — React ability to prepare several versions of the UI at once and to pause, resume or abandon rendering work so urgent updates are handled first.
- external store — State held outside React, in a library, a module variable or a browser API, which components subscribe to for changes.
Taught in
- Virtual DOM vs Real DOM: The Reconciliation Cost Model — React 19 & Modern Component Architecture
- Keys In Depth: Identity Preservation And Identity Resetting — React 19 & Modern Component Architecture
- Diffing Algorithm: Element Type Shifts And Subtree Tear Down — React 19 & Modern Component Architecture
- Custom Hook Composition: Encapsulating Reactive Logic — React 19 & Modern Component Architecture
- useSyncExternalStore: Tearing-Free Store Subscriptions — React 19 & Modern Component Architecture