import React, { useState, useEffect } from "react"; import { Link } from "react-router-dom"; import { connect } from "react-redux"; import { logOut } from "../actions/authActions"; import { useHistory } from "react-router-dom"; const Header = ({ logOut }) => { let history = useHistory(); function onLogOut() { logOut(); history.push("/"); } return (
); }; const mapStateToProps = (state) => ({ state: state, }); export default connect(mapStateToProps, { logOut })(Header);