type NavigationContext.NavigationMode
Type definition for an object supported by app.navigate() and NavigationContext.navigateAsync() that indicates how a new location should be applied.
type NavigationMode = {
back?: boolean;
replace?: boolean | "prefix";
prefix?: string;
};Notes
- Set the
backproperty totrueto navigate back in history before navigating to the new path. - Set the
replaceproperty totrueto replace the current path if possible; afterwards, going back in history won’t result in the current navigation path, but the one before it. - Set both properties to
trueto navigate back first, and then replace the (previous) navigation path. - Set the
replaceproperty to"prefix"to replace the current path only if the current path is a sub-path of the provided prefix (i.e."foo"matches"foo/bar"and"foo/bar/baz", but not"foo"itself or"foobar"). To match any non-root path (for root-level tabs or list-detail), set the prefix to an empty string. This can be used to implement a list-detail navigation pattern, or a tabbed navigation pattern.
Related
class NavigationContext abstract
An abstract class that encapsulates the current location within the application navigation stack, part of the global application context.
