mirror of
https://github.com/status-im/react-navigation.git
synced 2025-02-24 00:58:20 +00:00
Fix isTransitioning on nested navigate (#4520)
This bug wasnt apparent until we fixed the transitioner to fully respect isTransitioning. The router did not handle this properly until now. Enhanced a test to verify this in the future
This commit is contained in:
parent
e1df2c6c4a
commit
aebe8a5c23
@ -401,7 +401,10 @@ export default (routeConfigs, stackConfig = {}) => {
|
||||
routeName: childRouterName,
|
||||
key: action.key || generateKey(),
|
||||
};
|
||||
return StateUtils.push(state, route);
|
||||
return {
|
||||
...StateUtils.push(state, route),
|
||||
isTransitioning: action.immediate !== true,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -692,6 +692,7 @@ describe('StackRouter', () => {
|
||||
state
|
||||
);
|
||||
|
||||
expect(state2.isTransitioning).toEqual(true);
|
||||
expect(state2.index).toEqual(1);
|
||||
expect(state2.routes[1].index).toEqual(1);
|
||||
expect(state2.routes[1].routes[1].index).toEqual(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user