mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-10 22:47:02 +08:00
refactor: create initial state only once
This commit is contained in:
@@ -80,8 +80,8 @@ const StackRouter: Router<CommonAction | Action> = {
|
||||
if (state.routeNames === undefined || state.key === undefined) {
|
||||
state = {
|
||||
...state,
|
||||
routeNames: state.routeNames || routeNames,
|
||||
key: state.key || `stack-${shortid()}`,
|
||||
routeNames,
|
||||
key: `stack-${shortid()}`,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user