Skip to content

Commit

Permalink
docs: Added more link to TS section
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyoos committed Aug 13, 2024
1 parent 25b5f27 commit c448534
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions versioned_docs/version-7.x/navigation-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ export default function App() {

If you're using a regular ref object, keep in mind that the ref may be initially `null` in some situations (such as when linking is enabled). To make sure that the ref is initialized, you can use the [`onReady`](#onready) callback to get notified when the navigation container finishes mounting.

Check how to setup `ref` with TypeScript [here](typescript.md#annotating-ref-on-navigationcontainer).

See the [Navigating without the navigation prop](navigating-without-navigation-prop.md) guide for more details.

### Methods on the ref
Expand Down
2 changes: 2 additions & 0 deletions versioned_docs/version-7.x/screen-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Each screen can configure various aspects about how it gets presented in the nav

In the [configuring the header bar](headers.md) section of the fundamentals documentation we explain the basics of how this works. Also see the [screen options resolution guide](screen-options-resolution.md) to get an idea of how they work when there are multiple navigators.

See [our docs](typescript.md#annotating-options-and-screenoptions) to learn more about how to use TypeScript with `screenOptions` and `options`.

There are 3 ways of specifying options for screens:

### `options` prop on `Screen`
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-7.x/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ Specifying this type is important if you heavily use [`useNavigation`](use-navig

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 file (e.g. `navigation/types.ts`) that contains the types related to React Navigation.
1. It's good to create a separate file (e.g. `navigation/types.tsx`) that 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
2 changes: 2 additions & 0 deletions versioned_docs/version-7.x/use-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export default App;
</TabItem>
</Tabs>

Check how to setup `useNavigation` with TypeScript [here](typescript.md#annotating-usenavigation).

See the documentation for the [`navigation` object](navigation-object.md) for more info.

## Using with class component
Expand Down
2 changes: 2 additions & 0 deletions versioned_docs/version-7.x/use-route.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ export default App;
</TabItem>
</Tabs>

Check how to setup `useRoute` with TypeScript [here](typescript.md#annotating-useroute).

See the documentation for the [`route` object](route-object.md) for more info.

## Using with class component
Expand Down

0 comments on commit c448534

Please sign in to comment.