refactor(iOS): move RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED to const (#46833)

Summary:
This PR moves `RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED` as it was used as string in the codebase and in OSS libraries.

## Changelog:

[IOS] [FIXED] - move RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED to const

Pull Request resolved: https://github.com/facebook/react-native/pull/46833

Test Plan: CI Green

Reviewed By: cipolleschi

Differential Revision: D63891220

Pulled By: javache

fbshipit-source-id: d4fa1f751b4b0cb131ab6c6d4dd0a345762d7c71
This commit is contained in:
Oskar Kwaśniewski
2024-10-04 04:26:29 -07:00
committed by Facebook GitHub Bot
parent 47748c7935
commit a1ec345e2a
4 changed files with 7 additions and 2 deletions
@@ -14,6 +14,8 @@ RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollec
RCT_EXTERN NSString *const RCTWindowFrameDidChangeNotification;
RCT_EXTERN NSString *const RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED;
/**
* This notification fires when the bridge initializes.
*/
@@ -21,6 +21,9 @@ NSString *const RCTJavaScriptWillStartLoadingNotification = @"RCTJavaScriptWillS
NSString *const RCTDidInitializeModuleNotification = @"RCTDidInitializeModuleNotification";
NSString *const RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED =
@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED";
/*
* W3C Pointer Events
*/
@@ -58,7 +58,7 @@ RCT_EXPORT_MODULE()
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
[defaultCenter addObserver:self
selector:@selector(_notifyEventDispatcherObserversOfEvent_DEPRECATED:)
name:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
name:RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED
object:nil];
}
@@ -74,7 +74,7 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
userData:nil
coalescingKey:coalescingKey];
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:scrollEvent, @"event", nil];
[[NSNotificationCenter defaultCenter] postNotificationName:@"RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED"
[[NSNotificationCenter defaultCenter] postNotificationName:RCTNotifyEventDispatcherObserversOfEvent_DEPRECATED
object:nil
userInfo:userInfo];
}