You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using file based routing when navigation to a new route which does not have beforeLoad or loader functions, pending component is not shown until js bundle for that route page is fetched.
Go to cd examples/react/basic-file-based/ example in PR reproduction.
npm install && npm run start in the example
open example in the browser
add new custom throttling config under the chrome network dev tools with these values:
1kb download/upload and 4000ms latency.
go to root / route in the example and hard reload the page.
under the network switch to the newly created throttling config 1kb 4s latency
click the posts button link
Actual behavior: page content in browser does not change even though url is updated to /posts and when js bundle is loaded (up to 30s) posts page is shown. So pending component is never shown
Which project does this relate to?
Router
Describe the bug
Using file based routing when navigation to a new route which does not have
beforeLoad
orloader
functions, pending component is not shown until js bundle for that route page is fetched.Your Example Website or App
#3555
Steps to Reproduce the Bug or Issue
cd examples/react/basic-file-based/
example in PR reproduction.npm install && npm run start
in the example1kb download/upload and 4000ms latency.
/
route in the example and hard reload the page.1kb 4s latency
Actual behavior: page content in browser does not change even though url is updated to
/posts
and when js bundle is loaded (up to 30s) posts page is shown. So pending component is never shownExpected behavior
pending component is shown
Screenshots or Videos
https://vimeo.com/1059916543/32942fbde4
Platform
Additional context
In order to fix this issue we need to add one of these functions to route config to which we navigate:
beforeLoad
orloader
.But the best way to fix it for all routes is just to add
loader
to__root.tsx
file like this:Check out in reproduction PR these functions are commented. If we uncomment them the pending component is shown and issue no longer exists.
Discord discussion link: https://discord.com/channels/719702312431386674/1343677586345295973
The text was updated successfully, but these errors were encountered: