Skip to content

Commit

Permalink
Rename RCTRootViewFrameDidChangeNotification as it's not trac… (fac…
Browse files Browse the repository at this point in the history
…ebook#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
  • Loading branch information
Saadnajmi committed May 24, 2024
1 parent 2954e4f commit b7cc934
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,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];
}
#endif // [macOS]

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 @@ -16,7 +16,7 @@ RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollec
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationAppearanceKey;
#endif // macOS]

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

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/Base/RCTRootContentView.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ - (void)viewDidMoveToWindow

- (void)sendFrameChangedEvent:(__unused NSNotification *)notification
{
[[NSNotificationCenter defaultCenter] postNotificationName:RCTRootViewFrameDidChangeNotification object:self];
[[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
}

#endif // macOS]
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 @@ -82,7 +82,7 @@ - (void)initialize

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

Expand Down

0 comments on commit b7cc934

Please sign in to comment.