I am new to React. It's My First Program with React - Router When I Am Using React-Router I Don't get any data displaying on the window. It only Shows Blank Page.
My code - profile.js
import React from 'react'
function Profile()
{ return ( <div>
<h1>profile</h1>
</div> ) }
export default Profile
about.js file
import React from 'react'
function About() {
return (
<div>
<h1>about</h1>
</div>
)
}
export default About
App.js
import About from './Container/about'
import Profile from './Container/profile'
import {BrowserRouter, Route} from 'react-router-dom'
function App() {
return (
<div className="App">
<BrowserRouter>
<Route element={About} path='/about' />
<Route element={Profile } path='/profile' />
</BrowserRouter>
</div>
);
}
export default App;
If anybody Know any Solution Please Reply
I Checked some websites for results but I Don't get any solution from them. I watched some Youtube videos. but they code the same as mine and they got results but I didn't.