Skip to content

Commit

Permalink
Revert "pass props" (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
aksonov committed Mar 1, 2017
1 parent baec3ac commit ef00764
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions src/Reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,35 +220,19 @@ function inject(state, action, props, scenes) {
case ActionConst.JUMP: {
assert(state.tabs, `Parent=${state.key} is not tab bar, jump action is not valid`);
ind = -1;

let passProps = false;

state.children.forEach((c, i) => {
if (c.sceneKey === action.key) {
ind = i;

const isPass = state.children.filter(s => s.passProps && s.name === c.sceneKey);

if (isPass.length) {
passProps = true;
}
}
});

state.children.forEach((c, i) => { if (c.sceneKey === action.key) { ind = i; } });
assert(ind !== -1, `Cannot find route with key=${action.key} for parent=${state.key}`);

if (action.unmountScenes) {
resetHistoryStack(state.children[ind]);
}

if (passProps) {
state.children[ind] = getInitialState(
props,
scenes,
state.index,
action,
);
}
state.children[ind] = getInitialState(
props,
scenes,
state.index,
action,
);

return { ...state, index: ind };
}
Expand Down

0 comments on commit ef00764

Please sign in to comment.