Skip to content
Source
Sign inSign up
TanStack/router

feat(router-core): expose destination location to route lifecycle hooks #7778

Send to my agent
OpenLadyBluenotes(GitHub profile, opens in a new tab) opened this issue 0 comments

Problem

Route lifecycle hooks receive the route match but not the resolved destination location. Consumers need the destination URL and search state in onEnter, onStay, and onLeave.

Proposal

Add a second callback argument:

  • onEnter(match, { location })
  • onStay(match, { location })
  • onLeave(match, { location })

Supersedes stale #3622 - which targeted an older lifecycle implementation, lacked runtime coverage for onStay and onLeave, and left onLeave typing unresolved.

Sign in to join this conversation.