Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions packages/router-core/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1787,11 +1787,25 @@ export class RouterCore<
)
if (match) {
Object.assign(params, match.params) // Copy params, because they're cached
const { from: _from, ...maskProps } = match.route
const {
from: _from,
params: maskParams,
...maskProps
} = match.route

// If mask has a params function, call it with the matched params as context
// Otherwise, use the matched params or the provided params value
const nextParams =
maskParams === false || maskParams === null
? {}
: (maskParams ?? true) === true
? params
: Object.assign(params, functionalUpdate(maskParams, params))

maskedDest = {
from: opts.from,
...maskProps,
params,
params: nextParams,
}
maskedNext = build(maskedDest)
}
Expand Down Expand Up @@ -2096,7 +2110,6 @@ export class RouterCore<
updateMatch: this.updateMatch,
// eslint-disable-next-line @typescript-eslint/require-await
onReady: async () => {
// eslint-disable-next-line @typescript-eslint/require-await
// Wrap batch in framework-specific transition wrapper (e.g., Solid's startTransition)
this.startTransition(() => {
this.startViewTransition(async () => {
Expand Down
Loading
Loading