Skip to content

Commit

Permalink
Update packages/router/src/router.tsx
Browse files Browse the repository at this point in the history
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
  • Loading branch information
jtoar and Tobbe authored Aug 30, 2022
1 parent 93ddbbc commit ab0fc44
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/router/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,8 @@ const InternalRoute = ({
// Since we pass URL params to the page, we have to be careful not to pass `ref` or `key`, otherwise the page will break.
// (The page won't actually break if `key` is passed, but it feels unclean.)
// If users want to access them, they can use `useParams`.
;['ref', 'key'].forEach((specialProp) => {
if (Object.hasOwn(allParams, specialProp)) {
delete allParams[specialProp]
}
})
delete allParams['ref']
delete allParams['key']

// Level 3/3 (InternalRoute)
return <Page {...allParams} />
Expand Down

0 comments on commit ab0fc44

Please sign in to comment.