feat: proper iOS first renders measurements - #277
Merged
Merged
Conversation
exploIF
approved these changes
Nov 24, 2025
exploIF
left a comment
Collaborator
There was a problem hiding this comment.
Just one question, I see it's currently not an issue (but maybe it's just because of the fact that example app is almost empty, and super fast), shouldn't we somehow explicitly disable emitting events for mocked input or is it redundant?
Collaborator
Author
|
@exploIF oh definitely. Will add it |
exploIF
self-requested a review
November 24, 2025 10:33
exploIF
approved these changes
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #238 on iOS.
First render on iOS was looking pretty choppy because there was no way to measure the component on the very first render, because it's still not defined at that time.
This PR adds a mock text input that gets created as soon as the Shadow Node is created, gets the initial component's props and is used for measurements before the real input is defined. After that the mock gets unmounted (when the real input is finally defined).
Before vs After
Please play the videos at x0.25 speed to notice the choppiness:
Before:
firstRenderBefore.mov
After:
firstRenderAfter.mov
Test Plan
Add a state that toggles input's visibility, with the default visibility at
false. Then toggle it and see properly measured component appear with no intermediate states.Compatibility