TanStack / TanStack/router

docs: clarify enter and stay causes for parameter changes

Open Beginner friendly
#7,795 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The cause value passed to beforeLoad and loader is currently listed as enter, stay, or preload, but the docs do not explain what distinguishes enter from stay.

This is easy to misread when navigating between parameter values. For example, moving from /somepath/one to /somepath/hello%20world creates a different match ID, but the same route remains active, so the cause is stay.

It would help to clarify that:

  • enter means the route ID has newly entered the active route tree.
  • stay means the route ID remains active, including when path params or loader dependencies change.
  • preload applies to preloading work.

That should make it clearer when to use cause for route lifecycle behavior versus match-specific behavior.

Related Work: #3660

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

Search the documentation for the sections describing the cause value passed to beforeLoad and loader, and read the surrounding route lifecycle guidance. Clarify how enter, stay, and preload differ, including parameter changes that keep the same route ID active, then verify the updated wording against the example in this issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.