Skip to content
Discussion options

You must be logged in to vote

Hi @nickolasz523

If deploying to GitHub, ensure there is a "homepage" entry for where you are hosting it in Github.

Example:
"homepage": "https://nickolasz523.github.io/home",

Switch to the HashRouter since GitHub pages doesn't support the tech used by the BrowserRouter.

index.js

import React from 'react';
 import ReactDOM from 'react-dom/client';
 import { HashRouter } from 'react-router-dom'
 import App from './App';
 import './styles/index.css';

 ReactDOM.createRoot(document.getElementById('root')).render(
   <React.StrictMode>
     <HashRouter>
       <App />
     </HashRouter>
   </React.StrictMode>
 );

For more details see the create-react-app docs for https://create-react-app.de…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@zamachnoi
Comment options

Comment options

You must be logged in to vote
1 reply
@igor-h
Comment options

Answer selected by zamachnoi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pages Host a static website, right from your repo Product Feedback Share your thoughts and suggestions on GitHub features and improvements
3 participants