Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file extension typo #1331

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions versioned_docs/version-6.x/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ import type { RouteProp } from '@react-navigation/native';
type ProfileScreenRouteProp = RouteProp<RootStackParamList, 'Profile'>;
```

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

Expand Down Expand Up @@ -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.

Expand Down
Loading