RFC: Granular Subscription State #272
Open
+128
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This RFC proposes a way to reduce unnecessary re-renders by allowing components to subscribe only to the specific parts of state they actually use. The idea is to track property access within a selector and re-render only the components that depend on the changed value, rather than re-rendering entire subtrees.
The goal is to improve performance and developer experience in large React applications without changing existing mental models or requiring heavy memoization. The proposal outlines how this could work using a dependency map and a useGranular hook that integrates with useSyncExternalStore.
I’m opening this to start a discussion on whether this direction aligns with React’s long-term performance goals, and whether it makes sense as an experimental API or an external package first. Feedback on potential pitfalls, API shape, or integration considerations would be appreciated.
File added:
text/0000-granular-subscriptions.md
Looking forward to thoughts and discussion.