Skip to content

Commit

Permalink
fix: force interpolation of undefined path params to 'undefined'
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Dec 7, 2023
1 parent 42b83dd commit ad10ed0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/react-router/src/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export function interpolatePath(
}

if (segment.type === 'param') {
return params![segment.value.substring(1)] ?? ''
return params![segment.value.substring(1)] ?? 'undefined'
}

return segment.value
Expand Down
41 changes: 29 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ad10ed0

Please sign in to comment.