Skip to content

Commit 59aa64a

Browse files
committed
Add tip about defining memoizing linking config
1 parent 17b756f commit 59aa64a

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

versioned_docs/version-7.x/configuring-links.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ function App() {
8282

8383
When you specify the `linking` prop, React Navigation will handle incoming links automatically. On Android and iOS, it'll use React Native's [`Linking` module](https://reactnative.dev/docs/linking) to handle incoming links, both when the app was opened with the link, and when new links are received when the app is open. On the Web, it'll use the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to sync the URL with the browser.
8484

85-
:::warning
85+
You can also pass a [`fallback`](navigation-container.md#fallback) prop that controls what's displayed when React Navigation is trying to resolve the initial deep link URL.
8686

87-
Currently there seems to be bug ([facebook/react-native#25675](https://github.com/facebook/react-native/issues/25675)) which results in it never resolving on Android. We add a timeout to avoid getting stuck forever, but it means that the link might not be handled in some cases.
87+
:::tip
8888

89-
:::
89+
When passing a `linking` prop, define the `linking` object at the module-level or memoize it with `useMemo` so that React Navigation can cache the processed configuration.
9090

91-
You can also pass a [`fallback`](navigation-container.md#fallback) prop that controls what's displayed when React Navigation is trying to resolve the initial deep link URL.
91+
:::
9292

9393
## Prefixes
9494

versioned_docs/version-8.x/configuring-links.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ function App() {
107107

108108
The behavior can be customized further by specifying additional options in the `linking` prop as described below.
109109

110+
:::tip
111+
112+
When passing a `linking` prop, define the `linking` object at the module-level or memoize it with `useMemo` so that React Navigation can cache the processed configuration.
113+
114+
:::
115+
110116
## Prefixes
111117

112118
The `prefixes` option can be optionally used to specify custom schemes (e.g. `example://`) as well as host & domain names (e.g. `https://example.com`) if you have configured [Universal Links](https://developer.apple.com/ios/universal-links/) or [Android App Links](https://developer.android.com/training/app-links).

0 commit comments

Comments
 (0)