Handling /news vs /news/:id in React Router v7 Without Breaking Nested Routes
When working with React Router v7, a common scenario arises where you want /news itself to return a 404, while still keeping nested routes like /news/id/5 fully functional.
If you’re coming from v6, the good news is that v7 uses the same nested route structure, so the