How does URL rewrite work in Tanstack query?
I have updated my app.config.ts file with nitro config to rewrite / to /home
app.config.ts
But because / route does not exist, whenever I visit / i get a flash of /home before getting the 404 view
4 Replies
other-emerald•6mo ago
what's your definition of "rewrite" ?
mere-tealOP•6mo ago
I'm trying to proxy a request to a page to another page.
Here's an example of how it's done in next.js
https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites
next.config.js: rewrites | Next.js
Add rewrites to your Next.js app.
other-emerald•6mo ago
we don't support rewriting routes yet in that way
in your config, tanstack router is not aware that this rewrite is happening and thus cannot take it into account
we will add some API to do this in router in the future
mere-tealOP•6mo ago
Ok, noted. Will keep an eye out for the update