Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import React from 'react';
import {Route} from "react-router-dom"
import './App.css';
import { Home, About, Contact, Navigation } from './components';



const App = () => (
<div>
<Navigation />
<Route exact path={'/'} component={Home}/>
<Route exact path={'/About'} component={About}/>
<Route exact path={'/Contact'} component={Contact}/>
</div>
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/About.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

const About = () => <h1>About</h1>;
const About = () => <h1>About Time</h1>;

export default About;
2 changes: 1 addition & 1 deletion src/components/Contact.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

const Contact = () => <h1>Contact</h1>;
const Contact = () => <h1>Contact lenses</h1>;

export default Contact;
2 changes: 1 addition & 1 deletion src/components/Home.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

const Home = () => <h1>Home</h1>;
const Home = () => <h1>Home Sweet Home</h1>;

export default Home;
9 changes: 5 additions & 4 deletions src/components/Navigation.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import React from 'react';
import {Link} from 'react-router-dom'

const Navigation = () => {
const Navigation = () => {
return (
<div>
<div className="App">
<h1>React Router Mini</h1>
<div>
<a href="">Home</a>
<Link to='/'>Home</Link>
</div>
<div>
<a href="">About</a>
<Link to='About'>About</Link>
</div>
<div>
<a href="">Contact</a>
<Link to='Contact'>Contact</Link>
</div>
</div>
</div>
Expand Down
11 changes: 10 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@ import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import 'bootstrap/dist/css/bootstrap.css';
import {BrowserRouter as Router} from "react-router-dom"

ReactDOM.render(<App />, document.getElementById('root'));
const rootElement = document.getElementById('root');

ReactDOM.render(

<Router>

<App />

</Router>, rootElement );