Creating a Next.js like routing system in React.js #13201
Replies: 2 comments
|
hey there . |
|
I think this is definitely feasible, and I'd be interested in seeing it developed. Using React Router as the underlying router while adding a file-based routing layer on top could provide a Next.js-like developer experience without requiring developers to adopt the full Next.js framework. For example, a structure like: src/pages/ could automatically generate routes such as: / The main challenge would be building the file system scanner and route generator. A CLI or build plugin could analyze the pages directory and generate a route configuration file for React Router. Something similar could be done using Vite plugins, code generation, or Node.js filesystem APIs. The main advantage would be simplicity and familiarity for developers who like Next.js-style routing but want to build a client-side React application. The downside is that the project would need to clearly differentiate itself from existing solutions such as React Router's framework features, TanStack Router, and existing file-based routing plugins. I think the best way to validate the idea would be to build a small MVP first:
If the developer experience feels significantly easier than manually configuring React Router, then I think there could definitely be interest. I'd suggest starting small and publishing a proof of concept. The biggest value of the project would probably be the developer experience rather than replacing React Router itself. |
Uh oh!
There was an error while loading. Please reload this page.
I'm thinking about creating a Next.js like routing system in React.js. I'm not sure if this is something that people would be interested in, so I wanted to share my idea with the community and see what you think.
The idea is to use the React Router library to create a routing system that is similar to the one used in Next.js. This would allow developers to create complex web applications with multiple pages and routes without having to use Next.js.
I'm not sure if this is a feasible idea, but I'm willing to give it a try. If you're interested in helping me out, please let me know.
Here are some of the things that I'm thinking about:
I'm open to any feedback that you have. Please let me know what you think.
I hope this helps!
All reactions