mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-09 22:51:57 +08:00
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.