forked from shakacode/react-webpack-rails-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLayout.jsx
41 lines (38 loc) · 1.08 KB
/
Layout.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { NavLink as Link } from 'react-router-dom';
import './Layout.scss';
/* eslint-disable react/prefer-stateless-function */
export default class Layout extends Component {
static propTypes = {
children: PropTypes.object.isRequired,
};
/* eslint-disable react/no-unescaped-entities */
render() {
return (
<section>
<header>
<ul>
<li>
<Link exact to="/" activeClassName="active">
Comments (Root URL)
</Link>
</li>
<li>
<Link to="/react-router" activeClassName="active">
Test React Router ('/react-router')
</Link>
</li>
<li>
<Link to="/react-router/redirect" activeClassName="active">
Test Redirect
(url to '/react-router/redirect' which goes to root '/')
</Link>
</li>
</ul>
</header>
{this.props.children}
</section>
);
}
}