So previously the way to set the location on <StaticRouter /> is by manipulating its location prop. React Router v6 still supports this as shown in the docs here:
https://reactrouter.com/en/main/router-components/static-router
However, now it seems like the new recommended way is to create a static router using createStaticRouter as shown in the docs here:
https://reactrouter.com/en/main/routers/create-static-router
Is there a way to set the location when using a static router created with createStaticRouter?
To elaborate as to why I'm running into this issue: I'm currently server-side rendering and originally I was using BrowserRouter for my frontend router and a corresponding StaticRouter for the backend's server-side render.
I currently implement my error pages with the errorElement prop but I realized that error pages won't render and any thrown error will crash my apps because the prop requires usage within a data router to work. More on this issue is discussed in here:
https://github.com/remix-run/react-router/issues/10021
I did switch to using createBrowserRouter on my frontend and my error pages work there, but when I server-side render the server crashes because my Express server still relies on the location prop for <StaticRouter /> and I can't find a way to get the equivalent functionality with createStaticRouter.