Skip to content

Commit dc9cbdc

Browse files
committed
Use EventSubscription in API docs
1 parent 24e5c76 commit dc9cbdc

84 files changed

Lines changed: 96 additions & 96 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/accessibilityinfo.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static addEventListener(
8585
handler: (
8686
event: AccessibilityChangeEvent | AccessibilityAnnouncementFinishedEvent,
8787
) => void,
88-
): EmitterSubscription;
88+
): EventSubscription;
8989
```
9090

9191
Add an event handler. Supported events:

‎docs/appearance.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Supported values:
122122
```tsx
123123
static addChangeListener(
124124
listener: (preferences: {colorScheme: 'light' | 'dark' | null}) => void,
125-
): NativeEventSubscription;
125+
): EventSubscription;
126126
```
127127

128128
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'`.

‎docs/appstate.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Received when the user is not actively interacting with the app. Useful in situa
107107
static addEventListener(
108108
type: AppStateEvent,
109109
listener: (state: AppStateStatus) => void,
110-
): NativeEventSubscription;
110+
): EventSubscription;
111111
```
112112

113113
Sets up a function that will be called whenever the specified event type on AppState occurs. Valid values for `eventType` are

‎docs/backhandler.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const styles = StyleSheet.create({
102102
export default App;
103103
```
104104

105-
`BackHandler.addEventListener` creates an event listener & returns a `NativeEventSubscription` object which should be cleared using `NativeEventSubscription.remove` method.
105+
`BackHandler.addEventListener` creates an event listener & returns an `EventSubscription` object which should be cleared using the `EventSubscription.remove` method.
106106

107107
## Usage with React Navigation
108108

@@ -124,7 +124,7 @@ If you are using React Navigation to navigate across different screens, you can
124124
static addEventListener(
125125
eventName: BackPressEventName,
126126
handler: () => boolean | null | undefined,
127-
): NativeEventSubscription;
127+
): EventSubscription;
128128
```
129129

130130
---

‎docs/dimensions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static addEventListener(
105105
window,
106106
screen,
107107
}: DimensionsValue) => void,
108-
): EmitterSubscription;
108+
): EventSubscription;
109109
```
110110

111111
Add an event handler. Supported events:

‎docs/keyboard.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default Example;
7676
static addListener: (
7777
eventType: KeyboardEventName,
7878
listener: KeyboardEventListener,
79-
) => EmitterSubscription;
79+
) => EventSubscription;
8080
```
8181

8282
The `addListener` function connects a JavaScript function to an identified native keyboard notification event.

‎docs/linking.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ export default App;
557557
static addEventListener(
558558
type: 'url',
559559
handler: (event: {url: string}) => void,
560-
): EmitterSubscription;
560+
): EventSubscription;
561561
```
562562

563563
Add a handler to Linking changes by listening to the `url` event type and providing the handler.

‎website/versioned_docs/version-0.77/accessibilityinfo.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static addEventListener(
8585
handler: (
8686
event: AccessibilityChangeEvent | AccessibilityAnnouncementFinishedEvent,
8787
) => void,
88-
): EmitterSubscription;
88+
): EventSubscription;
8989
```
9090

9191
Add an event handler. Supported events:

‎website/versioned_docs/version-0.77/appearance.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Supported color schemes:
9696
```tsx
9797
static addChangeListener(
9898
listener: (preferences: {colorScheme: 'light' | 'dark' | null}) => void,
99-
): NativeEventSubscription;
99+
): EventSubscription;
100100
```
101101

102102
Add an event handler that is fired when appearance preferences change.

‎website/versioned_docs/version-0.77/appstate.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Received when the user is not actively interacting with the app. Useful in situa
107107
static addEventListener(
108108
type: AppStateEvent,
109109
listener: (state: AppStateStatus) => void,
110-
): NativeEventSubscription;
110+
): EventSubscription;
111111
```
112112

113113
Sets up a function that will be called whenever the specified event type on AppState occurs. Valid values for `eventType` are

0 commit comments

Comments
 (0)