Skip to content

Commit

Permalink
Rename RCTRootViewFrameDidChangeNotification as it's not trac… (#39835
Browse files Browse the repository at this point in the history
)

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
  • Loading branch information
Saadnajmi authored and huntie committed Oct 18, 2023
1 parent becb369 commit efcb841
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ - (void)windowScene:(UIWindowScene *)windowScene
interfaceOrientation:(UIInterfaceOrientation)previousInterfaceOrientation
traitCollection:(UITraitCollection *)previousTraitCollection API_AVAILABLE(ios(13.0))
{
[[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewFrameDidChangeNotification object:self];
[[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
}

#pragma mark - RCTCxxBridgeDelegate
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/Base/RCTConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RCT_EXTERN NSString *const RCTPlatformName;
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotification;
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey;

RCT_EXTERN NSString *const RCTRootViewFrameDidChangeNotification;
RCT_EXTERN NSString *const RCTWindowFrameDidChangeNotification;

/**
* This notification fires when the bridge initializes.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/Base/RCTConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
NSString *const RCTUserInterfaceStyleDidChangeNotification = @"RCTUserInterfaceStyleDidChangeNotification";
NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey = @"traitCollection";

NSString *const RCTRootViewFrameDidChangeNotification = @"RCTRootViewFrameDidChangeNotification";
NSString *const RCTWindowFrameDidChangeNotification = @"RCTWindowFrameDidChangeNotification";

NSString *const RCTJavaScriptDidFailToLoadNotification = @"RCTJavaScriptDidFailToLoadNotification";
NSString *const RCTJavaScriptDidLoadNotification = @"RCTJavaScriptDidLoadNotification";
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/CoreModules/RCTDeviceInfo.mm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ - (void)initialize

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(interfaceFrameDidChange)
name:RCTRootViewFrameDidChangeNotification
name:RCTWindowFrameDidChangeNotification
object:nil];
}

Expand Down

0 comments on commit efcb841

Please sign in to comment.