Home > Software design >  What did I do wrong when I tried to put the react project on the github pages?
What did I do wrong when I tried to put the react project on the github pages?

Time:07-27

I'm trying to make a deploy react app on github pages, but for some reason I get a blank page, please tell me what the problem is. Created via create-react-app

master branch - https://github.com/qmorozov/searchApp/tree/master

gh-pages branch - https://github.com/qmorozov/searchApp/tree/gh-pages

github pages - https://qmorozov.github.io/searchApp/

package.json file - https://github.com/qmorozov/searchApp/blob/master/package.json Got it right, all the scripts in the package.json are....

CodePudding user response:

Problem was in React router. It was necessary to change BrowserRoute to HashRouter.

        <HashRouter>
            <Routes>
                <Route path="/" element={<HomePage />}/>
                <Route path="search" element={<SearchPage />}/>
            </Routes>
        </HashRouter>
  • Related