From c09e25f38b1e619b0360c34a1720375eabe5b2fb Mon Sep 17 00:00:00 2001 From: Laryssa Rocha Date: Mon, 17 Mar 2025 18:34:51 -0300 Subject: [PATCH 1/2] docs: add warning about data routers to `useBlocker` --- docs/hooks/use-blocker.md | 3 +++ 1 file changed, 3 insertions(+) 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 From 60431486f5e46c61e95e5decf3c9d287bff9afdc Mon Sep 17 00:00:00 2001 From: Laryssa Rocha Date: Mon, 17 Mar 2025 18:50:27 -0300 Subject: [PATCH 2/2] chore: add `laryro` to the contributors --- contributors.yml | 1 + 1 file changed, 1 insertion(+) 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