Replies: 1 comment
-
After prerender, that URL is not going to be processed by RR anymore, it will go directly from your static server to the browser, you would need to either not prerender (generating the HTML is rarely a bottleneck anyway) or run a client loader on that route to redirect. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It looks like middleware is not run on prerendered pages when using a server like
@react-router/serve
. That's because prerendered pages are saved asindex.html
files in the build directory.Does react-router expose a method like
reactRouterModule.runMiddleware(request)
to be able to run it also on static files that are html pages?Should the default server be changed to do this by default before middleware is no longer unstable?
My use case is to redirect the user to the dashboard when the user visits the
/
index page (which is prerendered)Beta Was this translation helpful? Give feedback.
All reactions