Skip to content

Why was ReactContext chosen for state management? #974

@mfbx9da4

Description

@mfbx9da4

AFIK, React Context is really not intended for state management and requires heavy amounts of memoization to avoid unnecessary re-renders. What is the justification for using ReactContext for state management?

there is no way for a component that consumes a context to skip updates caused by new context values, even if it only cares about part of a new value.

https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/#context-and-rendering-behavior
https://frontarm.com/james-k-nelson/react-context-performance/

gz#16399

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions