diff --git a/contributors.yml b/contributors.yml index c6771a6f62..65f570562c 100644 --- a/contributors.yml +++ b/contributors.yml @@ -155,6 +155,7 @@ - KutnerUri - kylegirard - landisdesign +- laryro - latin-1 - lequangdongg - liuhanqu diff --git a/docs/hooks/use-blocker.md b/docs/hooks/use-blocker.md index e3c7600ba8..b86cddf03f 100644 --- a/docs/hooks/use-blocker.md +++ b/docs/hooks/use-blocker.md @@ -60,6 +60,8 @@ enum HistoryAction { The `useBlocker` hook allows you to prevent the user from navigating away from the current location, and present them with a custom UI to allow them to confirm the navigation. +This feature only works if using a data router, see [Picking a Router][pickingarouter] + This only works for client-side navigations within your React Router application and will not block document requests. To prevent document navigations you will need to add your own `beforeunload` event handler. @@ -134,3 +136,4 @@ When in a `blocked` state, you may call `blocker.proceed()` to proceed to the bl When in a `blocked` state, you may call `blocker.reset()` to return the blocker back to an `unblocked` state and leave the user at the current location. [example]: https://github.com/remix-run/react-router/tree/main/examples/navigation-blocking +[pickingarouter]: ../routers/picking-a-router