Commit dfb0643d authored by Zach Osman's avatar Zach Osman

Simple react router implementation

parent 76d017df
Pipeline #3203 passed with stage
in 57 seconds
......@@ -5,7 +5,7 @@ export default class HomePage extends React.Component {
render() {
return (
<div>
<p>Hello World!</p>
<p>Hello World! 1</p>
</div>
);
}
......
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import { BrowserRouter, Route, Link } from 'react-router-dom';
import { HomePage } from './Components';
// const App = () => (
// <div>
// <Header />
// <HomePage />
// </div>
// );
const Dhaynes = () => <p>dhaynes</p>;
const App = () => (
<div>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/dhaynes">dhaynes</Link>
</li>
</ul>
<Route path="/" exact component={HomePage} />
<Route path="/dhaynes" component={Dhaynes} />
</div>
);
ReactDOM.render(
<BrowserRouter>
<HomePage />
<App />
</BrowserRouter>,
document.getElementById('root')
);
......@@ -8,6 +8,7 @@
"license": "Apache-2.0",
"private": false,
"scripts": {
"start": "yarn dev",
"dev": "webpack --mode development ./go/go_ahead/src/index.js --output ./go/static/main.js --watch",
"build": "webpack --mode production ./project/frontend/src/index.js --output ./go/static/main.js"
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment