Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

305
Vistas
create-react-app: Automatically Route Based on Files In Directory

How can I modify create-react-app so that routes are automatically created for react components in a directory?

For instance, my src directory looks like this:

├── App.css
├── App.js
├── App.test.js
├── index.css
├── index.js
├── logo.svg
├── reportWebVitals.js
└── setupTests.js

I would like to modify it so that I a pages directory like this:

├── App.css
├── App.js
├── App.test.js
├── index.css
├── index.js
├── logo.svg
├── pages
│   ├── about.js
│   └── contact.js
├── reportWebVitals.js
└── setupTests.js

Then, without doing any extra manual adding of routes, I could visit localhost:3000/about and localhost:3000/contact and see the components rendered on those pages. I don't care if I have to do one time setup to get this working, but I do not want to modify any files other than the page itself whenever I add a new page.

I discovered this page but this relies on some Vite-specific things and I would prefer to continue using create-react-app.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda