I am facing a problem. I am trying to use React Router but it keeps showing me a blank page. Here is my code:
App.js:
import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import HomePage from "./HomePage";
function App() {
return (
<Router>
<Routes>
<Route path="/" element={<HomePage />} />
</Routes>
</Router>
);
};
export default App;
HomePage.js:
import React from "react";
import {withRouter} from "react-router-dom"
const HomePage = () => {
return <div>hi</div>
}
export default HomePage;
index.js:
import React from "react";
import ReactDom from "react-dom";
import App from './App';
ReactDom.render(<App/>, document.getElementById("root"))
I've installed "React Router V6", can anyone tell me what is the problem? Thanks for all the helpers.