Use functional component for Route

This commit is contained in:
Ken-Håvard Lieng 2017-05-19 07:28:08 +02:00
parent fc29c48013
commit 511b9e406c

View File

@ -1,15 +1,12 @@
import { PureComponent } from 'react';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
class Route extends PureComponent {
render() {
if (this.props.route === this.props.name) {
return this.props.children;
}
return null;
const Route = ({ route, name, children }) => {
if (route === name) {
return children;
}
}
return null;
};
const getRoute = state => state.router.route;