react-native
react-native copied to clipboard
fix(iOS) [0.74]: properly warn about createRootViewWithBridge
Summary:
This PR fixes an issue that _logWarnIfCreateRootViewWithBridgeIsOverridden was called in wrong place.
Assuming user overrides this method and call to [super]:
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initProps:(NSDictionary *)initProps {
UIView *view = [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];
view.backgroundColor = [UIColor redColor];
return view;
}
This method still wasn't called in bridgeless (and not showing the error).
Checking if user overrides this method in appDidFinishWithLaunching works every time
Changelog:
[IOS] [FIXED] - Properly warn about createRootViewWithBridge being deprecated
Test Plan:
Check if warning is shown when message is overridden
cc: @cipolleschi
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 17,935,061 | -65,622 |
| android | hermes | armeabi-v7a | n/a | -- |
| android | hermes | x86 | n/a | -- |
| android | hermes | x86_64 | n/a | -- |
| android | jsc | arm64-v8a | 21,293,286 | -65,778 |
| android | jsc | armeabi-v7a | n/a | -- |
| android | jsc | x86 | n/a | -- |
| android | jsc | x86_64 | n/a | -- |
Base commit: 073ca1aa03f74454d51dd6fa63f5c094e283e633 Branch: main
can you please add a cherry pick request in the proper discussion?
Added: https://github.com/reactwg/react-native-releases/discussions/104#discussioncomment-8557655
So I should re-target this to main?
probably yes.
@cipolleschi I've changed the target
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@cipolleschi merged this pull request in facebook/react-native@a1197695fc7dd7750001dc60853fd19f162dc69e.