Skip to content

Commit b7cc934

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 2954e4f commit b7cc934

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ - (void)windowScene:(UIWindowScene *)windowScene
235235
interfaceOrientation:(UIInterfaceOrientation)previousInterfaceOrientation
236236
traitCollection:(UITraitCollection *)previousTraitCollection API_AVAILABLE(ios(13.0))
237237
{
238-
[[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewFrameDidChangeNotification object:self];
238+
[[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
239239
}
240240
#endif // [macOS]
241241

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollec
1616
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationAppearanceKey;
1717
#endif // macOS]
1818

19-
RCT_EXTERN NSString *const RCTRootViewFrameDidChangeNotification;
19+
RCT_EXTERN NSString *const RCTWindowFrameDidChangeNotification;
2020

2121
/**
2222
* 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
@@ -20,7 +20,7 @@
2020
NSString *const RCTUserInterfaceStyleDidChangeNotificationAppearanceKey = @"appearance";
2121
#endif // macOS]
2222

23-
NSString *const RCTRootViewFrameDidChangeNotification = @"RCTRootViewFrameDidChangeNotification";
23+
NSString *const RCTWindowFrameDidChangeNotification = @"RCTWindowFrameDidChangeNotification";
2424

2525
NSString *const RCTJavaScriptDidFailToLoadNotification = @"RCTJavaScriptDidFailToLoadNotification";
2626
NSString *const RCTJavaScriptDidLoadNotification = @"RCTJavaScriptDidLoadNotification";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ - (void)viewDidMoveToWindow
7878

7979
- (void)sendFrameChangedEvent:(__unused NSNotification *)notification
8080
{
81-
[[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewFrameDidChangeNotification object:self];
81+
[[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
8282
}
8383

8484
#endif // macOS]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ - (void)initialize
8282

8383
[[NSNotificationCenter defaultCenter] addObserver:self
8484
selector:@selector(interfaceFrameDidChange)
85-
name:RCTRootViewFrameDidChangeNotification
85+
name:RCTWindowFrameDidChangeNotification
8686
object:nil];
8787
}
8888

0 commit comments

Comments
 (0)