import React from 'react' import { connect } from 'react-redux' import { Link } from 'react-router-dom' import { logout } from '../../actions/user' class Logout extends React.Component { componentDidMount() { this.props.UserLogout() } render() { return (
You are now logged out. Click here to log back in.
) } } export default connect( state => ({ user: state.user, }), dispatch => ({ UserLogout: () => { dispatch(logout()) } }) )(Logout)