Next.js Discord

Discord Forum

Dynamic routing data?

Unanswered
Ruwbix posted this in #help-forum
Open in Discord
I have app/destination/[destination].tsx. I have 2 destinations, I want to dynamically render data based on the path. What's the best way of doing this? I suppose just getting the name of the slug and then fetching it in a .json somewhere would work, but idk if that's the best with like these getStaticProps and what not which nextjs supports.

I'd also like to include i18n (translation).

Any help/suggestions'd be awesome!

2 Replies

Or would it be better to just copy the component twice (/destination/one, /destination/two) and just change the content manually?
Completed the [destination]/page.tsx, but now I want to change the data based on the route + add multiple translations for each route