From 6f97681cf08435b844261e9e1e8434dc7c67a1f4 Mon Sep 17 00:00:00 2001 From: Nima <88039431+n-ii-ma@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:45:01 +0330 Subject: [PATCH 1/2] Fix file extension typo Changed `type.tsx` to `type.ts` --- versioned_docs/version-6.x/typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-6.x/typescript.md b/versioned_docs/version-6.x/typescript.md index 0d4a2162af1..603d40ddf29 100755 --- a/versioned_docs/version-6.x/typescript.md +++ b/versioned_docs/version-6.x/typescript.md @@ -327,7 +327,7 @@ Specifying this type is important if you heavily use `useNavigation`, `Link` etc When writing types for React Navigation, there are a couple of things we recommend to keep things organized. -1. It's good to create a separate files (e.g. `navigation/types.tsx`) which contains the types related to React Navigation. +1. It's good to create a separate files (e.g. `navigation/types.ts`) which contains the types related to React Navigation. 2. Instead of using `CompositeNavigationProp` directly in your components, it's better to create a helper type that you can reuse. 3. Specifying a global type for your root navigator would avoid manual annotations in many places. From 8a1a7200fc93f34d81dc281338c9424d832d2cfe Mon Sep 17 00:00:00 2001 From: Nima <88039431+n-ii-ma@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:11:12 +0330 Subject: [PATCH 2/2] Fix file extension typo Changed type.tsx to type.ts --- versioned_docs/version-6.x/typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-6.x/typescript.md b/versioned_docs/version-6.x/typescript.md index 603d40ddf29..05334823f1c 100755 --- a/versioned_docs/version-6.x/typescript.md +++ b/versioned_docs/version-6.x/typescript.md @@ -143,7 +143,7 @@ import type { RouteProp } from '@react-navigation/native'; type ProfileScreenRouteProp = RouteProp; ``` -We recommend creating a separate `types.tsx` file where you keep the types and import them in your component files instead of repeating them in each file. +We recommend creating a separate `types.ts` file where you keep the types and import them in your component files instead of repeating them in each file. ### Nesting navigators