Commit c560531
authored
feat: proper iOS first renders measurements (#277)
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect -->
# 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:
https://github.com/user-attachments/assets/69aa524a-5ec1-4fbc-8220-610d2280eaf4
### After:
https://github.com/user-attachments/assets/8f07e5a1-67e5-4c6d-90df-d0b4f44e0f62
## 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
| OS | Implemented |
| ------- | :---------: |
| iOS | ✅ |
| Android | ✅(already done) |1 parent c666690 commit c560531
File tree
2 files changed
+47
-17
lines changed- ios/internals
2 files changed
+47
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
18 | 39 | | |
19 | 40 | | |
20 | 41 | | |
| |||
44 | 65 | | |
45 | 66 | | |
46 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
47 | 73 | | |
48 | 74 | | |
49 | 75 | | |
| |||
61 | 87 | | |
62 | 88 | | |
63 | 89 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
81 | 109 | | |
82 | 110 | | |
83 | 111 | | |
| |||
0 commit comments