What's the migration path for setSize on the UIManager? #36
-
I've started updating my navigation library to the new architecture on iOS. I have a In the old architecture on iOS I'd call - (void)layoutSubviews {
[super layoutSubviews];
if (!CGRectEqualToRect(_lastViewFrame, self.frame)) {
[_bridge.uiManager setSize:self.frame.size forView:self];
_lastViewFrame = self.frame;
}
} What's the way to do this in the new architecture on iOS? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hello @grahammendick, sorry for the slow response. I'm on a leave and rarely come to Github. The tldr is: take a look at how You might ask, why is it so complicated compared to the old architecture. The reason is that there may be several shadow nodes representing the same component view and imperative call to UIManager wouldn't work in such a case. We use React Native Rendered State Update to communicate the size change to Yoga and resize all affected nodes. Let me know if anything is unclear. Thank you |
Beta Was this translation helpful? Give feedback.
Hello @grahammendick,
sorry for the slow response. I'm on a leave and rarely come to Github.
The tldr is: take a look at how
ModalHostView
component does it. Relevant files:You might ask, why is it so complicated compared to the old architecture. The reason is that there may be several shadow nodes representing the same component view and imperative call to UIManager wouldn't work in such a case. We use React Native Rendered State Update to communicate the size change to Yoga and resize all affected nodes.
Let me know if anything is unclear.
Thank you