Skip to content

Pending component doesn't work on root route #2317

@geoff-harper

Description

@geoff-harper

Which project does this relate to?

Router

Describe the bug

I've noticed the pending component doesn't stay mounted if it's on the __root route. It seems like it does quickly render but doesn't stay until the __root loader method is finished, instead it instantly unmounts

Your Example Website or App

https://codesandbox.io/p/devbox/epic-shape-z676nh

Steps to Reproduce the Bug or Issue

  1. Verify that you see a green box on first load to verify that non __root pending component works
  2. Go to src\routes\index.tsx and comment out the pending component and loader
  3. Go to src\routes\__root.tsx and uncomment the same code from previous file
  4. Verify that the green box does not appear after refreshing window

Expected behavior

I expect to see the green box upon loading after the 4th repro step. I've left a red box as the router's default pending component to show that does seem to be working normally in all relevant cases

Screenshots or Videos

No response

Platform

  • Version: 1.57.8

Additional context

No response

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