Skip to content

Commit

Permalink
Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mgurgel committed Dec 17, 2024
1 parent 83fab7f commit c208379
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions v2/navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,12 @@ export function Navigation(props) {
// change component state
dispatch({ type: 'pop', opts: { animate: props.animate } });
},
/**
* Pops from current screen directly to primary screen
*/
popToRoot: () => {
// Replace current stack with only root screen and current screen
// Current screen will be popped right after
const primaryScreen = 'primaryScreen';
const newStack = /** @type {ScreenName[]} */ ([primaryScreen]);
if (state.stack.length > 1) {
Expand Down

0 comments on commit c208379

Please sign in to comment.