Gives path to home about and contacts
Fri Apr 02 2021 16:48:54 GMT+0000 (Coordinated Universal Time)
Saved by
@kanu_e
#javascript
import React from "react";
import { BrowserRouter as Router, Route } from 'react-router-dom';
const App = () => {
return (
<div >
<Route path="/" component={Home} />
<Route path="/about" component={About} />
<Route path="/contacts" component={Contacts} />
</div>
);
};
export default App;
ReactDOM.render(
<Router>
<App />
</Router>,
document.getElementById("root"));
const Home = () => {
return (
<div>
<h1>This is Our Home Page !</h1>
</div>
);
};
const About = () => {
return (
<div>
<h1>This is My about Page!</h1>
</div>
);
};
const Contacts = () => {
return (
<div>
<h1>This is My Contact Page!</h1>
</div>
);
};
content_copyCOPY
Comments