Skip to content

pendingComponent not shown while beforeLoad is pending #1104

@nklhtv

Description

@nklhtv

Describe the bug

pendingComponent not shown while beforeLoad is executing, but according to the docs it should.

If this function returns a promise, the route will be put into a pending state and cause rendering to suspend until the promise resolves. If this routes pendingMs threshold is reached, the pendingComponent will be shown until it resolved.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-hvbscg

Steps to Reproduce the Bug or Issue

  1. refresh the page
  2. rootRoute.pendingComponent is not shown until rootRoute.beforeLoad resolves (you see white screen for 5 seconds)
  3. rootRoute.pendingComponent is shown for 500 (default pendingMinMs)
  4. rootRoute.component is shown

Expected behavior

rootRoute.pendingComponent should be rendered while waiting for rootRoute.beforeLoad to resolve, just like with loader
OR
we should update the docs if thats not the actual expected behavior.

Screenshots or Videos

No response

Platform

  • OS: macOs
  • Browser: Firefox
  • Version: 121

Additional context

There is an open discussion about this behavior: #1029

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions