-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Which project does this relate to?
Router
Describe the bug
Discrepancy between types and the true path
const currentPagePath = useMatches({
select: matches => (matches.map(match => match.fullPath)),
})
console.log(currentPagePath, currentPagePath.includes('/database/$id/table')) // Types are ok hereBut in the console I see:
['/', '/', '/database/$id', '/database/$id/table/'], false
The table page has / but in types there is no any / as the end
Steps to Reproduce the Bug or Issue
- Create a page
/src/routes/database/$id/table/index.tsx - use
useMatches:
const currentPagePath = useMatches({
select: matches => matches.map(match => match.fullPath),
}) - See difference
Expected behavior
I expect to see the correct type or path
Screenshots or Videos
Platform
- Router / Start Version: 1.150.0
Additional context
You can use this page snippet:
import { createFileRoute, useMatches } from '@tanstack/react-router'
export const Route = createFileRoute('/database/$id/table/')({
component: RouteComponent,
})
function RouteComponent() {
const currentPagePath = useMatches({
select: matches => matches.map(match => match.fullPath),
})
console.log(currentPagePath, currentPagePath.includes('/database/$id/table'))
return <div>Hello "/database/$id/table/"!</div>
}juliomuhlbauer and Rudra-Sankha-Sinhamahapatra
Metadata
Metadata
Assignees
Labels
No labels