mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 22:39:41 +08:00
correction of a few documentation typo (#563)
This commit is contained in:
@@ -105,8 +105,8 @@ const MyApp = StackNavigator({
|
||||
}, {
|
||||
initialRouteName: 'Home',
|
||||
})
|
||||
MyApp.router = {
|
||||
...MyApp.router,
|
||||
const previousGetActionForPathAndParams = MyApp.router.getActionForPathAndParams
|
||||
Object.assign(MyApp.router, {
|
||||
getActionForPathAndParams(path, params) {
|
||||
if (
|
||||
path === 'my/custom/path' &&
|
||||
@@ -123,7 +123,7 @@ MyApp.router = {
|
||||
}),
|
||||
});
|
||||
}
|
||||
return MyApp.router.getStateForAction(action, state);
|
||||
return previousGetActionForPathAndParams(path, params);
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ You can make your own router by building an object with the following functions:
|
||||
|
||||
```js
|
||||
const MyRouter = {
|
||||
getStateForAction: (action) => ({}),
|
||||
getStateForAction: (action, state) => ({}),
|
||||
getActionForPathAndParams: (path, params) => null,
|
||||
getPathAndParamsForState: (state) => null,
|
||||
getComponentForState: (state) => MyScreen,
|
||||
|
||||
Reference in New Issue
Block a user