Uncaught Error: Too many re-renders. React limits the number of renders to prevent an infinite loop.
dispatch(changeCalendar(makeCalendar()));
dispatch가 실행되면 다시 렌더링되는데 다시 렌더링되면 또 dispatch가 실행되고 무한 반복에 빠진다. 따라서 첫 렌더링에만 실행되도록 useEffect를 쓰거나 콜백함수를 쓰면 해결된다.
On every render, PaisBody will be executed, it may cause an infinite loop because on each render you dispatch an action that may lead to re-render.
In such cases, you should use useEffect (with dep-array) or useCallback (if you going to share props):
https://stackoverflow.com/questions/57978675/react-hooks-too-many-re-renders-in-pagination-with-redux
useEffect(() => {
dispatch(changeCalendar(makeCalendar()));
}, []);