From fbb2e7486d84524d1cadd7709773fb8e5efef6da Mon Sep 17 00:00:00 2001 From: Peter Abbondanzo Date: Fri, 25 Sep 2026 11:59:03 -0400 Subject: [PATCH] Use EventSubscription in API docs --- docs/accessibilityinfo.md | 2 +- docs/appearance.md | 2 +- docs/appstate.md | 2 +- docs/backhandler.md | 4 ++-- docs/dimensions.md | 2 +- docs/keyboard.md | 2 +- docs/linking.md | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/accessibilityinfo.md b/docs/accessibilityinfo.md index 1c3ed89bc88..b585efd6f6c 100644 --- a/docs/accessibilityinfo.md +++ b/docs/accessibilityinfo.md @@ -85,7 +85,7 @@ static addEventListener( handler: ( event: AccessibilityChangeEvent | AccessibilityAnnouncementFinishedEvent, ) => void, -): EmitterSubscription; +): EventSubscription; ``` Add an event handler. Supported events: diff --git a/docs/appearance.md b/docs/appearance.md index 047c9b1e7c5..22cc758f47f 100644 --- a/docs/appearance.md +++ b/docs/appearance.md @@ -122,7 +122,7 @@ Supported values: ```tsx static addChangeListener( listener: (preferences: {colorScheme: 'light' | 'dark' | null}) => void, -): NativeEventSubscription; +): EventSubscription; ``` Add an event handler that is fired when appearance preferences change. On iOS and Android, the `colorScheme` value in the callback is always `'light'` or `'dark'`. diff --git a/docs/appstate.md b/docs/appstate.md index b5d6ad607f5..cc68ba5cc05 100644 --- a/docs/appstate.md +++ b/docs/appstate.md @@ -107,7 +107,7 @@ Received when the user is not actively interacting with the app. Useful in situa static addEventListener( type: AppStateEvent, listener: (state: AppStateStatus) => void, -): NativeEventSubscription; +): EventSubscription; ``` Sets up a function that will be called whenever the specified event type on AppState occurs. Valid values for `eventType` are diff --git a/docs/backhandler.md b/docs/backhandler.md index 9e1f2f7a94e..06237d2a0e5 100644 --- a/docs/backhandler.md +++ b/docs/backhandler.md @@ -102,7 +102,7 @@ const styles = StyleSheet.create({ export default App; ``` -`BackHandler.addEventListener` creates an event listener & returns a `NativeEventSubscription` object which should be cleared using `NativeEventSubscription.remove` method. +`BackHandler.addEventListener` creates an event listener & returns an `EventSubscription` object which should be cleared using the `EventSubscription.remove` method. ## Usage with React Navigation @@ -124,7 +124,7 @@ If you are using React Navigation to navigate across different screens, you can static addEventListener( eventName: BackPressEventName, handler: () => boolean | null | undefined, -): NativeEventSubscription; +): EventSubscription; ``` --- diff --git a/docs/dimensions.md b/docs/dimensions.md index b5bfa7635c7..f61f7ad2980 100644 --- a/docs/dimensions.md +++ b/docs/dimensions.md @@ -105,7 +105,7 @@ static addEventListener( window, screen, }: DimensionsValue) => void, -): EmitterSubscription; +): EventSubscription; ``` Add an event handler. Supported events: diff --git a/docs/keyboard.md b/docs/keyboard.md index c4951b2058c..6566ec1356d 100644 --- a/docs/keyboard.md +++ b/docs/keyboard.md @@ -76,7 +76,7 @@ export default Example; static addListener: ( eventType: KeyboardEventName, listener: KeyboardEventListener, -) => EmitterSubscription; +) => EventSubscription; ``` The `addListener` function connects a JavaScript function to an identified native keyboard notification event. diff --git a/docs/linking.md b/docs/linking.md index 939292522d5..e6095448cd0 100644 --- a/docs/linking.md +++ b/docs/linking.md @@ -557,7 +557,7 @@ export default App; static addEventListener( type: 'url', handler: (event: {url: string}) => void, -): EmitterSubscription; +): EventSubscription; ``` Add a handler to Linking changes by listening to the `url` event type and providing the handler.