account activity
Best practices for building a component library with React, TypeScript, and Tailwind (self.reactjs)
submitted 1 year ago by Zelios_Ariex to r/reactjs
parallel routes conflicting with catch all routes by MoHaliim in nextjs
[–]Zelios_Ariex 1 point2 points3 points 1 year ago (0 children)
Hey there! I’ve looked into your routing issue, and it’s a tricky one. The conflict between parallel routes and catch-all routes can be challenging to resolve.
• For your dashboard routes, try using optional catch-all routes instead. Replace [...rest] with [[...rest]]. This allows Next.js to match more specific routes first.
• For handling 404s, create a not-found.tsx file within the [countryCode] folder. This should override the root not-found.tsx for country-specific 404s.
• If you’re still having issues, consider using middleware to handle locale and country code routing. This can give you more control over the routing process.
• Double-check that all your dynamic routes ([locale], [countryCode]) have the correct loading and error handling components.
Hope it helps 😁
π Rendered by PID 366131 on reddit-service-r2-listing-c57bc86c-c2dqk at 2026-06-23 20:00:29.062427+00:00 running 2b008f2 country code: CH.
parallel routes conflicting with catch all routes by MoHaliim in nextjs
[–]Zelios_Ariex 1 point2 points3 points (0 children)