diff --git a/docs/the-new-architecture/native-modules-custom-events.md b/docs/the-new-architecture/native-modules-custom-events.md index 490e021ccfe..0af5bb95957 100644 --- a/docs/the-new-architecture/native-modules-custom-events.md +++ b/docs/the-new-architecture/native-modules-custom-events.md @@ -78,7 +78,7 @@ export default (TurboModuleRegistry.get( With the `import type` statement, you are importing the `CodegenTypes` from `react-native`, which includes the `EventEmitter` type. This allows you to define the `onKeyAdded` property using `CodegenTypes.EventEmitter`, specifying that the event will emit a payload of type `KeyValuePair`. -When the event is emitted, you expect for it to receive a parameter of type `string`. +When the event is emitted, you expect for it to receive a parameter of type `KeyValuePair`. ## Step 2: Generate Codegen @@ -265,7 +265,7 @@ With everything prepared, let's start writing native platform code. -Assuming you followed the guide for iOS described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. +Assuming you followed the guide for Android described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. To do so, you have to: diff --git a/docs/the-new-architecture/native-modules-lifecycle.md b/docs/the-new-architecture/native-modules-lifecycle.md index 08dbb1cba5a..361e845591e 100644 --- a/docs/the-new-architecture/native-modules-lifecycle.md +++ b/docs/the-new-architecture/native-modules-lifecycle.md @@ -2,11 +2,11 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import con # Native Modules Lifecycle -In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Modules the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. +In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Module the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. In a pure React Native app, the Native Modules are created once and they are never destroyed. However, in more complex apps, there might be use cases where the Native Modules are destroyed and recreated. Imagine, for example, a brownfield app that mixes some native views with some React Native surfaces, as presented in the [Integrating with Existing App guide](/docs/integration-with-existing-apps). In that case it might make sense to destroy a React Native instance when the user navigates away from a React Native surface and recreate it when the user navigates back to that surface. -When this happens, Native Module that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. +When this happens, Native Modules that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. In this guide, you will explore how to initialize and invalidate a Native Module properly. This guide assumes that you are familiar with how to write a Native Modules and you are comfortable writing native code. If you are not familiar with Native Modules, please read the [Native Modules guide](/docs/next/turbo-native-modules-introduction) first. diff --git a/website/versioned_docs/version-0.79/the-new-architecture/native-modules-custom-events.md b/website/versioned_docs/version-0.79/the-new-architecture/native-modules-custom-events.md index 99c0875fbe7..e5394fa3d5c 100644 --- a/website/versioned_docs/version-0.79/the-new-architecture/native-modules-custom-events.md +++ b/website/versioned_docs/version-0.79/the-new-architecture/native-modules-custom-events.md @@ -80,7 +80,7 @@ export default (TurboModuleRegistry.get( With the `import type` statement, you are importing the `EventEmitter` type that is required to then add the `onKeyAdded` property. -When the event is emitted, you expect for it to receive a parameter of type `string`. +When the event is emitted, you expect for it to receive a parameter of type `KeyValuePair`. ## Step 2: Generate Codegen @@ -267,7 +267,7 @@ With everything prepared, let's start writing native platform code. -Assuming you followed the guide for iOS described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. +Assuming you followed the guide for Android described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. To do so, you have to: diff --git a/website/versioned_docs/version-0.79/the-new-architecture/native-modules-lifecycle.md b/website/versioned_docs/version-0.79/the-new-architecture/native-modules-lifecycle.md index 5f9604ed39a..422fdb32e6a 100644 --- a/website/versioned_docs/version-0.79/the-new-architecture/native-modules-lifecycle.md +++ b/website/versioned_docs/version-0.79/the-new-architecture/native-modules-lifecycle.md @@ -2,11 +2,11 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import con # Native Modules Lifecycle -In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Modules the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. +In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Module the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. In a pure React Native app, the Native Modules are created once and they are never destroyed. However, in more complex apps, there might be use cases where the Native Modules are destroyed and recreated. Imagine, for example, a brownfield app that mixes some native views with some React Native surfaces, as presented in the [Integrating with Existing App guide](/docs/integration-with-existing-apps). In that case it might make sense to destroy a React Native instance when the user navigates away from a React Native surface and recreate it when the user navigates back to that surface. -When this happens, Native Module that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. +When this happens, Native Modules that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. In this guide, you will explore how to initialize and invalidate a Native Module properly. This guide assumes that you are familiar with how to write a Native Modules and you are comfortable writing native code. If you are not familiar with Native Modules, please read the [Native Modules guide](/docs/next/turbo-native-modules-introduction) first. diff --git a/website/versioned_docs/version-0.80/the-new-architecture/native-modules-custom-events.md b/website/versioned_docs/version-0.80/the-new-architecture/native-modules-custom-events.md index 490e021ccfe..0af5bb95957 100644 --- a/website/versioned_docs/version-0.80/the-new-architecture/native-modules-custom-events.md +++ b/website/versioned_docs/version-0.80/the-new-architecture/native-modules-custom-events.md @@ -78,7 +78,7 @@ export default (TurboModuleRegistry.get( With the `import type` statement, you are importing the `CodegenTypes` from `react-native`, which includes the `EventEmitter` type. This allows you to define the `onKeyAdded` property using `CodegenTypes.EventEmitter`, specifying that the event will emit a payload of type `KeyValuePair`. -When the event is emitted, you expect for it to receive a parameter of type `string`. +When the event is emitted, you expect for it to receive a parameter of type `KeyValuePair`. ## Step 2: Generate Codegen @@ -265,7 +265,7 @@ With everything prepared, let's start writing native platform code. -Assuming you followed the guide for iOS described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. +Assuming you followed the guide for Android described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. To do so, you have to: diff --git a/website/versioned_docs/version-0.80/the-new-architecture/native-modules-lifecycle.md b/website/versioned_docs/version-0.80/the-new-architecture/native-modules-lifecycle.md index 5f9604ed39a..422fdb32e6a 100644 --- a/website/versioned_docs/version-0.80/the-new-architecture/native-modules-lifecycle.md +++ b/website/versioned_docs/version-0.80/the-new-architecture/native-modules-lifecycle.md @@ -2,11 +2,11 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import con # Native Modules Lifecycle -In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Modules the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. +In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Module the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. In a pure React Native app, the Native Modules are created once and they are never destroyed. However, in more complex apps, there might be use cases where the Native Modules are destroyed and recreated. Imagine, for example, a brownfield app that mixes some native views with some React Native surfaces, as presented in the [Integrating with Existing App guide](/docs/integration-with-existing-apps). In that case it might make sense to destroy a React Native instance when the user navigates away from a React Native surface and recreate it when the user navigates back to that surface. -When this happens, Native Module that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. +When this happens, Native Modules that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. In this guide, you will explore how to initialize and invalidate a Native Module properly. This guide assumes that you are familiar with how to write a Native Modules and you are comfortable writing native code. If you are not familiar with Native Modules, please read the [Native Modules guide](/docs/next/turbo-native-modules-introduction) first. diff --git a/website/versioned_docs/version-0.81/the-new-architecture/native-modules-custom-events.md b/website/versioned_docs/version-0.81/the-new-architecture/native-modules-custom-events.md index 490e021ccfe..0af5bb95957 100644 --- a/website/versioned_docs/version-0.81/the-new-architecture/native-modules-custom-events.md +++ b/website/versioned_docs/version-0.81/the-new-architecture/native-modules-custom-events.md @@ -78,7 +78,7 @@ export default (TurboModuleRegistry.get( With the `import type` statement, you are importing the `CodegenTypes` from `react-native`, which includes the `EventEmitter` type. This allows you to define the `onKeyAdded` property using `CodegenTypes.EventEmitter`, specifying that the event will emit a payload of type `KeyValuePair`. -When the event is emitted, you expect for it to receive a parameter of type `string`. +When the event is emitted, you expect for it to receive a parameter of type `KeyValuePair`. ## Step 2: Generate Codegen @@ -265,7 +265,7 @@ With everything prepared, let's start writing native platform code. -Assuming you followed the guide for iOS described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. +Assuming you followed the guide for Android described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. To do so, you have to: diff --git a/website/versioned_docs/version-0.81/the-new-architecture/native-modules-lifecycle.md b/website/versioned_docs/version-0.81/the-new-architecture/native-modules-lifecycle.md index 08dbb1cba5a..361e845591e 100644 --- a/website/versioned_docs/version-0.81/the-new-architecture/native-modules-lifecycle.md +++ b/website/versioned_docs/version-0.81/the-new-architecture/native-modules-lifecycle.md @@ -2,11 +2,11 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import con # Native Modules Lifecycle -In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Modules the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. +In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Module the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. In a pure React Native app, the Native Modules are created once and they are never destroyed. However, in more complex apps, there might be use cases where the Native Modules are destroyed and recreated. Imagine, for example, a brownfield app that mixes some native views with some React Native surfaces, as presented in the [Integrating with Existing App guide](/docs/integration-with-existing-apps). In that case it might make sense to destroy a React Native instance when the user navigates away from a React Native surface and recreate it when the user navigates back to that surface. -When this happens, Native Module that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. +When this happens, Native Modules that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. In this guide, you will explore how to initialize and invalidate a Native Module properly. This guide assumes that you are familiar with how to write a Native Modules and you are comfortable writing native code. If you are not familiar with Native Modules, please read the [Native Modules guide](/docs/next/turbo-native-modules-introduction) first. diff --git a/website/versioned_docs/version-0.82/the-new-architecture/native-modules-custom-events.md b/website/versioned_docs/version-0.82/the-new-architecture/native-modules-custom-events.md index 490e021ccfe..0af5bb95957 100644 --- a/website/versioned_docs/version-0.82/the-new-architecture/native-modules-custom-events.md +++ b/website/versioned_docs/version-0.82/the-new-architecture/native-modules-custom-events.md @@ -78,7 +78,7 @@ export default (TurboModuleRegistry.get( With the `import type` statement, you are importing the `CodegenTypes` from `react-native`, which includes the `EventEmitter` type. This allows you to define the `onKeyAdded` property using `CodegenTypes.EventEmitter`, specifying that the event will emit a payload of type `KeyValuePair`. -When the event is emitted, you expect for it to receive a parameter of type `string`. +When the event is emitted, you expect for it to receive a parameter of type `KeyValuePair`. ## Step 2: Generate Codegen @@ -265,7 +265,7 @@ With everything prepared, let's start writing native platform code. -Assuming you followed the guide for iOS described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. +Assuming you followed the guide for Android described in the [Native Modules guide](/docs/turbo-native-modules-introduction?platforms=android&language=typescript#3-write-application-code-using-the-turbo-native-module), what's left to do is to plug the code that emit the events in your app. To do so, you have to: diff --git a/website/versioned_docs/version-0.82/the-new-architecture/native-modules-lifecycle.md b/website/versioned_docs/version-0.82/the-new-architecture/native-modules-lifecycle.md index 08dbb1cba5a..361e845591e 100644 --- a/website/versioned_docs/version-0.82/the-new-architecture/native-modules-lifecycle.md +++ b/website/versioned_docs/version-0.82/the-new-architecture/native-modules-lifecycle.md @@ -2,11 +2,11 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import con # Native Modules Lifecycle -In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Modules the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. +In React Native, Native Modules are singleton. The Native Module infrastructure lazily creates a Native Module the first time it is accessed and it keeps it around whenever the app requires it. This is a performance optimization that allows us to avoid the overhead of creating Native Modules eagerly, at app start, and it ensure faster startup times. In a pure React Native app, the Native Modules are created once and they are never destroyed. However, in more complex apps, there might be use cases where the Native Modules are destroyed and recreated. Imagine, for example, a brownfield app that mixes some native views with some React Native surfaces, as presented in the [Integrating with Existing App guide](/docs/integration-with-existing-apps). In that case it might make sense to destroy a React Native instance when the user navigates away from a React Native surface and recreate it when the user navigates back to that surface. -When this happens, Native Module that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. +When this happens, Native Modules that are stateless won't cause any issues. However, for stateful Native Modules it might be necessary to properly invalidate the Native Module to ensure that the state is reset and the resources released. In this guide, you will explore how to initialize and invalidate a Native Module properly. This guide assumes that you are familiar with how to write a Native Modules and you are comfortable writing native code. If you are not familiar with Native Modules, please read the [Native Modules guide](/docs/next/turbo-native-modules-introduction) first.