Skip to content

API Reference / @gtkx/navigation / usePreventRemove

Function: usePreventRemove() ​

usePreventRemove(preventRemove, callback): void

Hook to prevent screen from being removed. Can be used to prevent users from leaving the screen.

Parameters ​

preventRemove ​

boolean

Boolean indicating whether to prevent screen from being removed.

callback ​

(options) => void

Function which is executed when screen was prevented from being removed.

Returns ​

void