import React from 'react'; import { Route, Redirect } from 'react-router-dom'; import { connect } from 'react-redux'; import { isLoaded } from '../util/loadingObject'; // From https://github.com/gillisd/react-router-v4-redux-auth const PrivateRoute = ({component: ComposedComponent, ...rest}) => { class Authentication extends React.Component { // redirect if not authenticated; otherwise, // return the component input into handleRender(props) { if (!this.props.authenticated) { return } else { return } } render() { return ( ) } } function mapStateToProps(state) { return {authenticated: isLoaded(state.auth)}; } const AuthenticationContainer = connect(mapStateToProps)(Authentication) return } export { PrivateRoute };