Skip to content

Conversation

@szydlovsky
Copy link
Collaborator

@szydlovsky szydlovsky commented Nov 26, 2025

Summary

First render (or rather render without an accessible Component View) used a mock component view for measurements as a static member of the Shadow Node. For obvious reasons this won't work with multiple inputs on the same screen.
Original motivation for having mock as a member was to have it created as soon as possible (Shadow Node constructor) to make sure it can be measured on the first render. Turns out it can be very well created just when needed (as long as on main thread) without any first render performance losses.
This PR remakes and simplifies this approach so that we don't need a static member anymore.

Test Plan

Run iOS example app and add a simple state to conditionally render the component. Record its first renders and notice it still properly is rendered with the proper height at once, no stutters or jumps.

Screenshots / Videos

--

Compatibility

OS Implemented
iOS
Android

@szydlovsky szydlovsky merged commit 8b19d36 into main Nov 27, 2025
5 checks passed
@szydlovsky szydlovsky deleted the @szydlovsky/ios-first-measure-improvement branch November 27, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants