diff options
Diffstat (limited to 'src/lib/routes/helpers.ts')
-rw-r--r-- | src/lib/routes/helpers.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/routes/helpers.ts b/src/lib/routes/helpers.ts index 071e1ae9b..8aef5b83a 100644 --- a/src/lib/routes/helpers.ts +++ b/src/lib/routes/helpers.ts @@ -55,10 +55,15 @@ export function getTabState(state: State | undefined, tab: string): TabState { return TabState.Outside } +type ExistingState = { + name: string + params?: RouteParams +} export function buildStateObject( stack: string, route: string, params: RouteParams, + state: ExistingState[] = [], ) { if (stack === 'Flat') { return { @@ -70,7 +75,7 @@ export function buildStateObject( { name: stack, state: { - routes: [{name: route, params}], + routes: [...state, {name: route, params}], }, }, ], |