Skip to content

Commit 625d0ec

Browse files
Saadnajmifacebook-github-bot
authored andcommitted
Rename RCTRootViewFrameDidChangeNotification as it's not trac… (#39835)
Summary: …king root view frame changes Looking through where this was introduced (#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: #39835 Test Plan: CI should pass Reviewed By: cipolleschi Differential Revision: D50173742 Pulled By: javache fbshipit-source-id: 4651696174c439800984a5e6cf642200bb9c4f3c
1 parent 4fdc594 commit 625d0ec

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ - (void)windowScene:(UIWindowScene *)windowScene
196196
interfaceOrientation:(UIInterfaceOrientation)previousInterfaceOrientation
197197
traitCollection:(UITraitCollection *)previousTraitCollection API_AVAILABLE(ios(13.0))
198198
{
199-
[[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewFrameDidChangeNotification object:self];
199+
[[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
200200
}
201201

202202
#pragma mark - RCTCxxBridgeDelegate

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RCT_EXTERN NSString *const RCTPlatformName;
1212
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotification;
1313
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey;
1414

15-
RCT_EXTERN NSString *const RCTRootViewFrameDidChangeNotification;
15+
RCT_EXTERN NSString *const RCTWindowFrameDidChangeNotification;
1616

1717
/**
1818
* This notification fires when the bridge initializes.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
NSString *const RCTUserInterfaceStyleDidChangeNotification = @"RCTUserInterfaceStyleDidChangeNotification";
1313
NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey = @"traitCollection";
1414

15-
NSString *const RCTRootViewFrameDidChangeNotification = @"RCTRootViewFrameDidChangeNotification";
15+
NSString *const RCTWindowFrameDidChangeNotification = @"RCTWindowFrameDidChangeNotification";
1616

1717
NSString *const RCTJavaScriptDidFailToLoadNotification = @"RCTJavaScriptDidFailToLoadNotification";
1818
NSString *const RCTJavaScriptDidLoadNotification = @"RCTJavaScriptDidLoadNotification";

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ - (void)initialize
7373

7474
[[NSNotificationCenter defaultCenter] addObserver:self
7575
selector:@selector(interfaceFrameDidChange)
76-
name:RCTRootViewFrameDidChangeNotification
76+
name:RCTWindowFrameDidChangeNotification
7777
object:nil];
7878
}
7979

0 commit comments

Comments
 (0)