Two routes one page (optional parameter)
is there a way to have query like this
whatever/ID/SECOND_ID
where they both point to the same page but the SECOND_ID
is optional? So even if you just put whatever/1
instead of whatever/1/2
it still match the same page1 Reply
absent-sapphire•15mo ago
there currently is no supported fo optional path parameters. you need to create two separate routes, e.g.
routes/whatever/$id.tsx
routes/whatever/$id.$secondId.tsx
and then render the same component in both routes