router icon indicating copy to clipboard operation
router copied to clipboard

set defaultPendingMs to 0 throw an error when root route is not wrapped in suspense

Open GuillaumeLaroucheUQAT opened this issue 1 year ago • 0 comments

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

  1. Set defaultPendingMs to 0 instead of 1
  2. 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.

GuillaumeLaroucheUQAT avatar Jan 29 '24 17:01 GuillaumeLaroucheUQAT