You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(iOS): update view controller once per transaction when adding header subviews (#2623)
## Description
In #2466 I've introduced `RCTMountingTransactionObserving` for
`RNSScreenStackHeaderConfig` component.
Now we can use this to reduce amount of calls to
`updateViewControllerIfNeeded` (causing layout passes) when adding
subviews.
I'm not changing the `unmount` path of the code as we have some more
additional logic there which requires some more
careful consideration.
This also aligns us with Paper implementation. Note that it has been
only implemented this way, because at the implementation time there was
no way
to run this code on transaction completion.
## Changes
`- [RNSScreenStackHeaderConfig updateViewControllerIfNeeded]` is now
called only once per transaction when adding subviews to header config.
## Test code and steps to reproduce
Test432, TestHeaderTitle, Test2552 - see that there are no regressions.
> [!note]
During testing I've found that there is a bug with subview layout when
modifying subviews after first render. This is not a regression however.
Notice the wrong position of header right on video below 👇🏻 (Test432)
https://github.com/user-attachments/assets/7f8653e8-a7d9-4fb8-a875-182e7deb0495
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes
0 commit comments