Routing: Dynamic segment in the middle of a route
Answered
Common carp posted this in #help-forum
Common carpOP
I'm trying to create such route
/foo-{query}-baz and I can't find anything on the topic. I tried creating foo-[query]-baz.tsx but that does not work unfortunately. Is this possible with Next.js? I'm using Pages router. ThanksAnswered by joulev
that's not possible, you have to use
[slug].tsx and parse query to the slug in the form of foo-[query]-baz and back2 Replies
@Common carp I'm trying to create such route `/foo-{query}-baz` and I can't find anything on the topic. I tried creating `foo-[query]-baz.tsx` but that does not work unfortunately. Is this possible with Next.js? I'm using Pages router. Thanks
that's not possible, you have to use
[slug].tsx and parse query to the slug in the form of foo-[query]-baz and backAnswer
Common carpOP
Thanks @joulev