You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-5.x/use-link-builder.md
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -6,20 +6,20 @@ sidebar_label: useLinkBuilder
6
6
7
7
> Note: This API is experimental and might change in a minor version.
8
8
9
-
The `useLinkBuilder` hook let's us build a path to use for links based on a `navigate` action. It returns a function that takes `name` and `params` for the screen to navigate to and returns path based on the [`linking` options](navigation-container.md#linking).
9
+
The `useLinkBuilder` hook let's us build a path to use for links for a screen in the current navigator's state. It returns a function that takes `name` and `params` for the screen to focus and returns path based on the [`linking` options](navigation-container.md#linking).
This hook is intended to be used in navigators to show links to various pages in it, such as drawer and tab navigators. If you're building a custom navigator, custom drawer content, custom tab bar etc. then you might want to use this hook.
31
31
32
-
It's important to note that `useLinkBuilder` doesn't consider bubbling of the `navigate` action when building the link. So the screen to navigate to must be present in the navigator it's used in. For example, in the above case, the navigator containing `Home` should also contain the `Profile` screen.
32
+
There are couple of important things to note:
33
+
34
+
- The destination screen must be present in the current navigator. It cannot be in a parent navigator or a navigator nested in a child.
35
+
- It's intended to be only used in custom navigators to keep them reusable in multiple apps. For your regular app code, use paths directly instead of building paths for screens.
Copy file name to clipboardExpand all lines: versioned_docs/version-5.x/web-support.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,9 @@ Currently, the following features are available:
13
13
-[URL integration in browser](configuring-links.md)
14
14
-[Accessible links](link.md)
15
15
16
-
Some navigators are also configured differently on web or provide additional web specific features:
16
+
It's important to use links as the primary way of navigation instead of navigation actions such as `navigation.navigate`. It'll ensure that your links are properly usable on web.
17
+
18
+
Some of the navigators are also configured differently on web or provide additional web specific features:
17
19
18
20
1. The [drawer](drawer-navigator.md) and [bottom tab](bottom-tab-navigator.md) navigators show hyperlinks in the drawer sidebar and tab bar respectively.
19
21
2. Swipe gestures are not available on [drawer](drawer-navigator.md) and [stack](stack-navigator.md) navigators when using on the web.
0 commit comments