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
The
causevalue passed tobeforeLoadandloaderis currently listed asenter,stay, orpreload, but the docs do not explain what distinguishesenterfromstay.This is easy to misread when navigating between parameter values. For example, moving from
/somepath/oneto/somepath/hello%20worldcreates a different match ID, but the same route remains active, so the cause isstay.It would help to clarify that:
entermeans the route ID has newly entered the active route tree.staymeans the route ID remains active, including when path params or loader dependencies change.preloadapplies to preloading work.That should make it clearer when to use
causefor route lifecycle behavior versus match-specific behavior.Related Work: #3660