router
router copied to clipboard
set defaultPendingMs to 0 throw an error when root route is not wrapped in suspense
Describe the bug
Setting defaultPendingMs to 0 render the errorComponent if the root route has no pendingComponent or is not wrapped in Suspsense even if a child route has a pendingComponent.
The error message :
A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.
This can be temporary fixed by setting defaultPendingMs to 1.
Your Example Website or App
https://stackblitz.com/edit/github-ew6yjc?file=src%2Fmain.tsx
Steps to Reproduce the Bug or Issue
- Set
defaultPendingMsto 0 instead of 1 - The route render the errorComponent
Expected behavior
The first matching route should render the pendingComponent until the promise is resolved instead of the root route errorComponent.
Screenshots or Videos
No response
Platform
- OS: Windows
- Browser: Chrome
- Version: 121
Additional context
There was no error before the new not found API.