Skip to content

Commit 108280f

Browse files
committed
Rename RCTRootViewFrameDidChangeNotification as it's not trac… (facebook#39835)
Summary: …king root view frame changes Looking through where this was introduced (facebook#37649), it seems the notification went from tracking root view size changes to window size changes. However, it was not renamed. I was using it for root view changes in RN-macOS, which.. I guess I'll refactor. Meanwhile, let's update the name? ## Changelog: [IOS] [CHANGED] - Rename `RCTRootViewFrameDidChangeNotification` as it's not tracking root view frame changes Pull Request resolved: facebook#39835 Test Plan: CI should pass Reviewed By: cipolleschi Differential Revision: D50173742 Pulled By: javache fbshipit-source-id: 4651696174c439800984a5e6cf642200bb9c4f3c
1 parent 8d7d8f9 commit 108280f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ - (void)windowScene:(UIWindowScene *)windowScene
180180
interfaceOrientation:(UIInterfaceOrientation)previousInterfaceOrientation
181181
traitCollection:(UITraitCollection *)previousTraitCollection API_AVAILABLE(ios(13.0))
182182
{
183-
[[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewFrameDidChangeNotification object:self];
183+
[[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
184184
}
185185

186186
#pragma mark - RCTCxxBridgeDelegate

packages/react-native/React/Base/RCTConstants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotification;
1111
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey;
1212

13-
RCT_EXTERN NSString *const RCTRootViewFrameDidChangeNotification;
13+
RCT_EXTERN NSString *const RCTWindowFrameDidChangeNotification;
1414

1515
/**
1616
* This notification fires when the bridge initializes.

packages/react-native/React/Base/RCTConstants.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
NSString *const RCTUserInterfaceStyleDidChangeNotification = @"RCTUserInterfaceStyleDidChangeNotification";
1111
NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey = @"traitCollection";
1212

13-
NSString *const RCTRootViewFrameDidChangeNotification = @"RCTRootViewFrameDidChangeNotification";
13+
NSString *const RCTWindowFrameDidChangeNotification = @"RCTWindowFrameDidChangeNotification";
1414

1515
NSString *const RCTJavaScriptDidFailToLoadNotification = @"RCTJavaScriptDidFailToLoadNotification";
1616
NSString *const RCTJavaScriptDidLoadNotification = @"RCTJavaScriptDidLoadNotification";

packages/react-native/React/CoreModules/RCTDeviceInfo.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ - (void)initialize
7979
#endif // [macOS]
8080
[[NSNotificationCenter defaultCenter] addObserver:self
8181
selector:@selector(interfaceFrameDidChange)
82-
name:RCTRootViewFrameDidChangeNotification
82+
name:RCTWindowFrameDidChangeNotification
8383
object:nil];
8484
}
8585

0 commit comments

Comments
 (0)