Commit 7d3205e
committed
Do not send initial natively sized frame of HeaderSubview from HT to ST
When setting subviews via `setOptions` from `useEffect` hook in a
component, the first frame received might be computed by native
layout & completely invalid (zero height). RN layout is the source of a
subview **size** (not origin). When we send such update with zero height
Yoga might (or might not, depending on exact update timing in relation
to other ongoing commits / layouts) set the subview height to 0!
This causes the subview to become invisible & we want to avoid that.
This had not been a problem before #2696, because we would filter out
this kind of frame in the `setSize` guard in the
`ComponentDescriptor.adopt` method of the `HeaderSubview`. #2696 allowed
for zero-sized frames for other, unrelated reason & we must allow these
as long as they come from React Native layout & not native one.1 parent b1e9c71 commit 7d3205e
File tree
1 file changed
+19
-2
lines changed- android/src/main/java/com/swmansion/rnscreens
1 file changed
+19
-2
lines changedLines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
| |||
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | | - | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| |||
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
47 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
| |||
0 commit comments