79634415

Date: 2025-05-22 19:34:27
Score: 1.5
Natty:
Report link

Ok, so I conclude 'This is not possible yet'.

So I wanted to move a simple SPA from React -> next.js since the React docs recommend this framework, and next.js recommends app router. However, `next.js's app router can't even do this yet (more here): https://github.com/vercel/next.js/discussions/55393

I read discussions on the official next.js repository, and people are still asking for this feature, but it's not available yet. They are saying in pages router we can do it, but next.js recommends app router.

As a workaround, people are using /blogs/?slug=[<value>] instead of /blogs/[slug]

enter image description here

For my use case, I just wanted to use file-based routing that next.js provides instead of react-router, since React docs suggest this framework, and just get SPA output to deploy on CDN, but it doesn't seem to be possible after the research I did, Given that I am still open to new answers or work around if you find, Thanks.

enter image description here

References:

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Visrut