Skip to content

pending component is rendered for routes that have no loader #1349

@TkDodo

Description

@TkDodo

Describe the bug

A route that has no loader shouldn't show the pending component - yet the pendingComponent is rendered for defaultPendingMinMs even if it has no loader.

To see this we need to have a defaultPendingMinMs defined while having defaultPendingMs:0, and we need to have a defaultPendingComponent defined.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-lwvn2j?file=src%2Fmain.tsx,src%2Froutes%2Fabout.tsx

Steps to Reproduce the Bug or Issue

  • navigate between Home and About

--> you should see the loading... text for 1 second on both pages, even though there is no loader for any of them.

Expected behavior

we should only see the pending component if the route is actually loading something, which it can't if there is no loader.

Screenshots or Videos

No response

Platform

all

Additional context

note that the error is tied to defaultPendingMs: 0. If we change it to defaultPendingMs: 1, it works as expected.

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