Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!