dispatch/client/js/containers/Route.js

18 lines
361 B
JavaScript
Raw Normal View History

import { createStructuredSelector } from 'reselect';
import connect from 'utils/connect';
2017-05-19 05:28:08 +00:00
const Route = ({ route, name, children }) => {
if (route === name) {
return children;
}
2017-05-19 05:28:08 +00:00
return null;
};
const getRoute = state => state.router.route;
const mapState = createStructuredSelector({
route: getRoute
});
export default connect(mapState)(Route);