Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Pass updated props to an existing route
  • Loading branch information
lrettig committed Feb 26, 2016
commit 8e70b15dfe73628559f88fa8445d6a42473b9f43
4 changes: 3 additions & 1 deletion ExRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,12 @@ export default class ExRouter extends React.Component {
const routes = navigator.getCurrentRoutes();
const exist = routes.filter(el=>el.getName()==route.name);
if (exist.length){
// navigator.jumpTo does not allow us to pass new props to an
// existing route, so we do it manually.
exist[0].props = props;
navigator.jumpTo(exist[0]);
} else {
navigator.push(new ExRouteAdapter(route, props));

}
this.setState({selected: route.name});
return true;
Expand Down