| useBlocker | R Documentation |
https://api.reactrouter.com/v7/functions/react-router.useBlocker.html
useBlocker(
into = NULL,
as = "children",
selector = "state",
render = NULL,
shouldBlock = FALSE,
...
)
into |
A component (HTML tag or shiny.react-based element) that will receive the hook data as the specified prop. |
as |
Character. The name of the component's prop to inject the hook
data into (by default |
selector |
Character. Optional key to extract from the hook data object.
If |
render |
Optional |
shouldBlock |
Either |
... |
Additional props to pass to the component. |
Calls the useBlocker() hook and injects the blocker's state
(or another selector field) as a prop of the into
component. Use to intercept navigation – e.g. warn the user about unsaved
changes before they leave a route.
The blocker state is one of "unblocked" (default),
"blocked" (navigation intercepted), or "proceeding"
(user confirmed, navigation in progress).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.