I'm trying to deploy my react app, it works fine with the / page but the routes are a hell...
React code :
import { BrowserRouter, Route, Routes, HashRouter } from "react-router-dom";
export default function App() {
return (
<div>
<HashRouter basename="/">
<Routes>
<Route path="/" element={<h1>FJSDHNAOUSHSDOASHJNDAOIS</h1>} />
<Route
path="/perro"
element={
<img src="https://www.laguiadelvaron.com/wp-content/uploads/2018/03/facebook-omnitrix7-1520172526.jpg"></img>
}
/>
</Routes>
</HashRouter>
</div>
);
}
I installed gh-page so I had this package.json :
"homepage": "https://bonafo.github.io/",
"scripts": {
"start": "react-scripts start",
"predeploy" :"npm run build",
"deploy" : "gh-pages -d build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
I don't know where the error... but the only thing I get when I test the /perro is the 404 from GitHub... I also tried with BrowserRouter, but the same result...
Github repo : https://github.com/BONAFO/bonafo.github.io
Thanks.