onHostNavigationRequested
Home > @gooddata/sdk-pluggable-application-model > IPluggableApplicationMountHandle > onHostNavigationRequested
IPluggableApplicationMountHandle.onHostNavigationRequested property
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Asks the application whether the host may navigate away from it.
Signature:
onHostNavigationRequested?: (request: IHostNavigationRequest) => boolean;
Remarks
The host chrome owns navigation (workspace picker, application menu, logo), so an application holding unsaved user work cannot intercept it on its own — its own header is not rendered and its router does not observe host navigation. The host asks before a chrome-initiated push whose target pathname differs from the current one; programmatic redirects (replace) and navigations staying on the same pathname are not offered.
Return true to take over: the host does not navigate, and the application calls proceed once the user confirms — or never, if the user cancels. Return false to let the host navigate immediately. Applications without unsaved state may omit it.
proceed performs the host's original navigation, so the application does not need to know how host routing works.