I have try to call my routes form App.js file but this is not working properly. I have try many times but browser gets the blank screen. Am totally new to react js Framework
App.js:
import React from 'react';
import { BrowserRouter, Route,Routes} from 'react-router-dom';
import Login from './Components/Login/Login';
function App() {
return (
<div className="App">
<BrowserRouter>
<Routes>
<Route path="/" exact={true} component={Login}></Route>
<Route path="/login" exact={true} component={Login}></Route>
</Routes>
</BrowserRouter>
</div>
);
}
export default App;
Login Component here:(Login.js)
import React from "react";
const Login = () => {
return (
<form>
<h3>Sign In</h3>
<div className="form-group">
<label>Email address</label>
<input
type="email"
className="form-control"
placeholder="Enter email"
/>
</div>
</form>
);
};
export default Login;