Commit bb86f5b
fix(iOS): header snapshots not working (#2393)
The `updateViewControllerIfNeeded` call introduced by
#2230
forces the view controller to rebuild the subviews with the recent
config.
When the screen is being unmounted it replaces the subviews with nil
values as the `reactSubviews` are removed from the config one by one.
Snapshots made earlier get discarded in the process.
This PR adds a condition that prevents updating the view controller when
the screen is being changed + stops unnecessary snapshots when the
screen is not changed.
- updated `Test556.tsx` repro
- added `isGoingToBeRemoved` property to `RNSScreenView`
- making snapshots / updating the view controller conditionally
<!--
-->
- Use `Test556.tsx` repro
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes
---------
Co-authored-by: Kacper Kafara <[email protected]>
Co-authored-by: Kacper Kafara <[email protected]>
(cherry picked from commit e4333a1)1 parent 5a9afbb commit bb86f5b
File tree
5 files changed
+99
-34
lines changed- apps/src/tests
- ios
5 files changed
+99
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
10 | | - | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
43 | 65 | | |
44 | 66 | | |
45 | 67 | | |
| |||
55 | 77 | | |
56 | 78 | | |
57 | 79 | | |
| 80 | + | |
| 81 | + | |
58 | 82 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
63 | 108 | | |
64 | 109 | | |
65 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| |||
690 | 693 | | |
691 | 694 | | |
692 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
693 | 701 | | |
694 | 702 | | |
695 | 703 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1175 | 1175 | | |
1176 | 1176 | | |
1177 | 1177 | | |
| 1178 | + | |
1178 | 1179 | | |
1179 | 1180 | | |
1180 | 1181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
771 | | - | |
772 | | - | |
773 | | - | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
774 | 777 | | |
775 | 778 | | |
776 | | - | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
777 | 782 | | |
778 | 783 | | |
779 | 784 | | |
| |||
0 commit comments