TanStack / TanStack/router

Add a way to opt out of the default pending component

Open
#7,773 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
15.1k
Forks
1.9k
Avg merge
1d 20h
Merged PRs (30d)
143

Description

Problem

Routes that render their own loading state have no way to opt out of the router's default pending component.

pendingComponent currently falls back to the configured default whenever a route is pending. Setting the option to null or undefined does not disable that fallback.

Proposed solution

Add an explicit opt-out value:

export const Route = createFileRoute('/example')({
  pendingComponent: 'never',
})

This should prevent the default pending component from rendering while preserving the route's pending behavior.

Opening this issue because there was PR #2658 addressing it but it is outdated now.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the pendingComponent option from createFileRoute and the router's default pending-component selection. Review the outdated PR #2658 for prior context, then locate the relevant pending-state tests or add coverage nearby. Done means accepting pendingComponent: 'never' so the default does not render while route pending behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.