Skip to content

Consolidate hooks in usePseudoStates and useStyleTransition#511

Open
ixf wants to merge 1 commit into
react:mainfrom
ixf:perf/pseudo-hooks
Open

Consolidate hooks in usePseudoStates and useStyleTransition#511
ixf wants to merge 1 commit into
react:mainfrom
ixf:perf/pseudo-hooks

Conversation

@ixf

@ixf ixf commented Jul 23, 2026

Copy link
Copy Markdown

This reduces RSD's memory overhead in React Native. Measured with https://github.com/ixf/rsd-bench - in this bench it drops retained memory by ~15%

  • use less useState's. It has a measurable impact since it's used in everywhere
  • remove unnecessary useRef and useEffect - transitionMetadata doesn't need to be set in a separate useEffect. It can be bundled into the state because it's used in the other useEffect which only reacts to the changes in state anyway

@meta-cla meta-cla Bot added the cla signed label Jul 23, 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