mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-28 20:35:19 +08:00
feat: make deep link handling more flexible
This adds ability to specify a custom config to control how to convert between state and path.
Example:
```js
{
Chat: {
path: 'chat/:author/:id',
parse: { id: Number }
}
}
```
The above config can parse a path matching the provided pattern: `chat/jane/42` to a valid state:
```js
{
routes: [
{
name: 'Chat',
params: { author: 'jane', id: 42 },
},
],
}
```
This makes it much easier to control the parsing without having to specify a custom function.
This commit is contained in:
committed by
Satyajit Sahoo
parent
17045f5b6d
commit
849d952703
@@ -31,7 +31,7 @@
|
||||
"@types/jest": "^24.0.13",
|
||||
"codecov": "^3.5.0",
|
||||
"commitlint": "^8.0.0",
|
||||
"core-js": "^3.1.4",
|
||||
"core-js": "^3.2.1",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-satya164": "^2.4.1",
|
||||
"husky": "^2.4.0",
|
||||
|
||||
Reference in New Issue
Block a user