Reduxの簡単な使い方



import {useDispatch} from 'react-redux';
import {setUserInfo} from '../redux/modules/user';
import {getPosts} from '../redux/modules/posts';


function SignIn() {
	
const userInfo = useSelector((state)=> state.user);

const dispatch = useDispatch();

const getClick = () => {
	dispatch(getPosts())
}

const ChangeClick = () => {
	dispatch(setUserInfo({userInfo}))
              // userInfo는 서버에서 받아온 유저정보
}
};