Skip to content
Permalink
Browse files

feat: basic routing with example

  • Loading branch information...
Param-Harrison committed Apr 11, 2019
1 parent 02bfb1c commit 3db2531748a6f314f108c4b1024118c2d89e41a3
Showing with 28 additions and 2 deletions.
  1. +8 −1 src/App.css
  2. +20 −1 src/App.js
@@ -1 +1,8 @@
/* styles will come here */
.App {
text-align: center;
margin: 10px;
}

a {
margin: 0 10px;
}
@@ -1,10 +1,29 @@
import React from 'react';
import { Link, BrowserRouter as Router, Route } from 'react-router-dom';
import './App.css';

const IndexPage = () => {
return (
<h3>Home Page</h3>
);
};

const AboutPage = () => {
return (
<h3>About Page</h3>
);
};

const App = () => {
return (
<section className="App">
<h1>React Router example</h1>
<Router>
<Link to="/">Home</Link>
<Link to="/about">About</Link>
<Route exact path="/" component={IndexPage} />
<Route exact path="/about" component={AboutPage} />
</Router>
<a href="/about">about with browser reload</a>
</section>
);
};

0 comments on commit 3db2531

Please sign in to comment.
You can’t perform that action at this time.