autoCodeSplitting causes entire app rerender
When autoCodeSplitting is set to true in vite config, every time I change anything in a route.tsx file, entire app re-renders. If i extract the part I want to change in a separate file (so not only component but new file) then only the component itself re-renders.
Disabling the plugin makes everything work normally, ie. changing something in a route.tsx file doesn't rerender the entire app, just the part that got changed.
This is what vite outputs as being updated with
autoCodeSplitting
on:
(tanstack-router-provider.tsx is just a file where I inject the data into router context and return the tsr RouterProvider wrapper)
This is with off:
4 Replies
wise-white•11mo ago
can you please provide a complete minimal example with exact repro steps?
fair-roseOP•11mo ago
any example just setting the option above to true, for eg forked basic file based routing example:
https://stackblitz.com/edit/tanstack-router-vtnul4?file=src/routes/index.tsx,vite.config.js,src/routes/_layout.tsx&preset=node
try changing anything inside any of the route files (index/posts/etc..) and you will see the entire page flashing instead of just the part in the route.
wise-white•11mo ago
thanks, can you please create a github issue so this gets tracked?
fair-roseOP•11mo ago
sorry for the delay, opened it here: https://github.com/TanStack/router/issues/2676
GitHub
autoCodeSplitting causes entire app re-render · Issue #2676 · TanSt...
Which project does this relate to? Router Describe the bug When autoCodeSplitting is set to true in vite.config.ts, every time I change anything in a route file, entire app re-renders. If i extract...