React · Senior · Question 18 of 75

What is tearing in concurrent rendering?

Explanation

If rendering is interrupted and an external store (not React state) changes in the meantime, some components read the old value and others the new one. useSyncExternalStore protects against this. That's why third-party stores should subscribe through it rather than useEffect + useState.

Further reading

Problem with a question

React · Senior · question 18

Test yourself

Take the React · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz