diff --git a/.changeset/long-jokes-wait.md b/.changeset/long-jokes-wait.md new file mode 100644 index 0000000000..4c85a2bb63 --- /dev/null +++ b/.changeset/long-jokes-wait.md @@ -0,0 +1,5 @@ +--- +"react-router-dom": patch +--- + +Fix useBlocker to return IDLE_BLOCKER during SSR diff --git a/packages/react-router-dom/server.tsx b/packages/react-router-dom/server.tsx index 3ace651b43..6e9c6cd365 100644 --- a/packages/react-router-dom/server.tsx +++ b/packages/react-router-dom/server.tsx @@ -7,6 +7,7 @@ import type { StaticHandlerContext, } from "@remix-run/router"; import { + IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, Action, @@ -299,7 +300,7 @@ export function createStaticRouter( throw msg("dispose"); }, getBlocker() { - throw msg("getBlocker"); + return IDLE_BLOCKER; }, deleteBlocker() { throw msg("deleteBlocker");