solid-router
solid-router copied to clipboard
useMatch can not match optional parameters
Describe the bug
const TAG_PATH = '/tags/:label/:entryId?'
<Route path={TAG_PATH} ... />
...
const isMatch = useMatch(() =>TAG_PATH)
Here useMatch(() =>TAG_PATH) can match path with 'entryId' param like '/tags/1/2', but can not match path '/tags/100'
Your Example Website or App
https://stackblitz.com/edit/vitejs-vite-c19mmd?file=src/App.tsx
Steps to Reproduce the Bug or Issue
Click '/categories/1 ' link, it does not match current location.
Expected behavior
It should match.
Screenshots or Videos
No response
Platform
- OS: all
- Browser: all
- Version: 1.5
Additional context
No response