Skip to content

Share style environment subscriptions - #514

Open
ixf wants to merge 2 commits into
react:mainfrom
ixf:perf/style-hooks
Open

Share style environment subscriptions#514
ixf wants to merge 2 commits into
react:mainfrom
ixf:perf/style-hooks

Conversation

@ixf

@ixf ixf commented Jul 29, 2026

Copy link
Copy Markdown

This reduces RSD's memory overhead in React Native. Measured with https://github.com/ixf/rsd-bench - exact numbers in the readme there

  • combine dimensions, color scheme and reduced motion into one store - StyleEnvironmentStore, which replaces PrefersReducedMotionStore - no need to keep two stores around, and wrapping dimensions and color scheme hooks into them reduces number of subscriptions per useStyleProps call
  • remove useMemo from useCustomProperties. It has two call sites and the useMemo was useless in both cases

@meta-cla meta-cla Bot added the cla signed label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant