Skip to content

Commit

Permalink
docs(deeplinks):update docs v5 and v7
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-hertel committed Oct 6, 2023
1 parent be3f053 commit e911e55
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions versioned_docs/version-5.x/configuring-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,22 @@ const state = {
};
```

The `initialRouteName` property is also valid as a top-level key, this is useful if you want to add a base screen to a top-level route

```js
const config = {
initialRouteName: 'Feed',
screens: {
Home: {
screens: {
Profile: 'users/:id',
Settings: 'settings',
},
},
},
};
```

It's not possible to pass params to the initial screen through the URL. So make sure that your initial route doesn't need any params or specify `initialParams` to pass required params.

In this case, any params in the URL are only passed to the `Profile` screen which matches the path pattern `users/:id`, and the `Feed` screen doesn't receive any params. If you want to have the same params in the `Feed` screen, you can specify a [custom `getStateFromPath` function](navigation-container.md#linkinggetstatefrompath) and copy those params.
Expand Down
16 changes: 16 additions & 0 deletions versioned_docs/version-7.x/configuring-links.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,22 @@ const state = {
};
```
The `initialRouteName` property is also valid as a top-level key, this is useful if you want to add a base screen to a top-level route
```js
const config = {
initialRouteName: 'Feed',
screens: {
Home: {
screens: {
Profile: 'users/:id',
Settings: 'settings',
},
},
},
};
```
It's not possible to pass params to the initial screen through the URL. So make sure that your initial route doesn't need any params or specify `initialParams` to pass required params.
In this case, any params in the URL are only passed to the `Profile` screen which matches the path pattern `users/:id`, and the `Feed` screen doesn't receive any params. If you want to have the same params in the `Feed` screen, you can specify a [custom `getStateFromPath` function](navigation-container.md#linkinggetstatefrompath) and copy those params.
Expand Down

0 comments on commit e911e55

Please sign in to comment.