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
Is there a way for libraries to support multiple RN versions with new architecture.
For example for rn 0.74 we'd had to add an extra param to LayoutMetrics. But I assume this will not build with 0.73 anymore.
Is there an #ifdef or something so we can support both 0.74 or 0.73 with the same library version?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there a way for libraries to support multiple RN versions with new architecture.
For example for rn 0.74 we'd had to add an extra param to
LayoutMetrics
. But I assume this will not build with 0.73 anymore.Is there an
#ifdef
or something so we can support both 0.74 or 0.73 with the same library version?- (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics oldLayoutMetrics:(const LayoutMetrics &)oldLayoutMetrics { CGRect prev = _view.frame; CGRect next = RCTCGRectFromRect(layoutMetrics.frame); BOOL frameDidChange = !CGRectEqualToRect(next, prev); if (frameDidChange) { next = CGRectMake(0, 0, next.size.width, next.size.height); } LayoutMetrics newLayoutMetrics = LayoutMetrics{ RCTRectFromCGRect(next), layoutMetrics.contentInsets, layoutMetrics.borderWidth, layoutMetrics.displayType, + layoutMetrics.positionType, // RN074 layoutMetrics.layoutDirection, layoutMetrics.wasLeftAndRightSwapped, layoutMetrics.pointScaleFactor,
See also reactwg/react-native-releases#64 (comment)
Beta Was this translation helpful? Give feedback.
All reactions