-
Notifications
You must be signed in to change notification settings - Fork 25k
fix(iOS) [0.74]: properly warn about createRootViewWithBridge #43146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(iOS) [0.74]: properly warn about createRootViewWithBridge #43146
Conversation
|
cc: @cipolleschi |
Base commit: 073ca1a |
|
can you please add a cherry pick request in the proper discussion? |
|
Added: reactwg/react-native-releases#104 (comment) So I should re-target this to main? |
|
probably yes. |
3b3925a to
a18663c
Compare
a18663c to
5d9b8b2
Compare
|
@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 a119769. |
Summary:
This PR fixes an issue that `_logWarnIfCreateRootViewWithBridgeIsOverridden` was called in wrong place.
Assuming user overrides this method and call to `[super]`:
```objc
- (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
Pull Request resolved: #43146
Test Plan: Check if warning is shown when message is overridden
Reviewed By: huntie
Differential Revision: D54303506
Pulled By: cipolleschi
fbshipit-source-id: cf30555c791493f28b3015a189cf93b60cace8f8
…ok#43146) Summary: This PR fixes an issue that `_logWarnIfCreateRootViewWithBridgeIsOverridden` was called in wrong place. Assuming user overrides this method and call to `[super]`: ```objc - (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 Pull Request resolved: facebook#43146 Test Plan: Check if warning is shown when message is overridden Reviewed By: huntie Differential Revision: D54303506 Pulled By: cipolleschi fbshipit-source-id: cf30555c791493f28b3015a189cf93b60cace8f8
Summary:
This PR fixes an issue that
_logWarnIfCreateRootViewWithBridgeIsOverriddenwas called in wrong place.Assuming user overrides this method and call to
[super]:This method still wasn't called in bridgeless (and not showing the error).
Checking if user overrides this method in
appDidFinishWithLaunchingworks every timeChangelog:
[IOS] [FIXED] - Properly warn about
createRootViewWithBridgebeing deprecatedTest Plan:
Check if warning is shown when message is overridden