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

118
Vistas
react-router-dom v6 issue with gh-pages

I am having an issue with githubpages with react-router-dom v6

my package.json


{
    "name": "weatherly-app",
    "version": "0.1.0",
    "homepage": "https://ahmedgaafer.github.io/weatherly-app/",

    "dependencies": {
        "react": "^18.1.0",
        "react-dom": "^18.1.0",
        "react-router-dom": "^6.3.0",
        "react-scripts": "5.0.1",
    },
    "scripts": {
        "predeploy": "npm run build",
        "deploy": "gh-pages -d build -r https://github.com/ahmedgaafer/weatherly-app",
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
    },
    
    
    "devDependencies": {
        "gh-pages": "^4.0.0"
    }
}


my routing file.js


root.render(
    <React.StrictMode>
        <Provider store={store}>
            <BrowserRouter>
                <Routes>
                    <Route path="/" exact element={<LandingPage />} />
                    <Route path="/dashboard" element={<Dashboard />} />
                </Routes>
            </BrowserRouter>
        </Provider>
    </React.StrictMode>,
);

when I run the npm run deploy command and try to view the page the component in the routes are not rendered and an empty page is displayed I know the code is deployed correctly because the CSS background-colour is displayed in the correct color

The only issue is that the components does not render

LINK TO THE APP : https://ahmedgaafer.github.io/weatherly-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