correction of a few documentation typo (#563)

This commit is contained in:
mbaroukh
2017-03-16 23:35:53 +01:00
committed by Eric Vicenti
parent 255a4361aa
commit 0820366a1c
2 changed files with 4 additions and 4 deletions

View File

@@ -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);
},
};
```

View File

@@ -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,