다 작성한 뒤에는 logout 액션 생성 함수를 디스패치하는 onLogout 함수를 만들어서 Header 컴포넌트에 전달해 주세요.
containers/common/HeaderContainer.js
import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; import Header from '../../components/common/Header'; import { logout } from '../../modules/user'; const HeaderContainer = () => { const { user } = useSelector(({ user }) => ({ user: user.user })); const dispatch = useDispatch(); const onLogout = () => { dispatch(logout()); }; return <Header user={user} onLogout={onLogout} />; }; export default HeaderContainer;