-
카테고리
-
세부 분야
풀스택
-
해결 여부
미해결
TypeError: nextCallback is not a function (next-redux-wrapper 7.0)
21.06.12 04:51 작성 조회수 796
11
next-redux-wrapper가 7.0.0 버전으로 업데이트되면서 수정사항이 생겼습니다.
에러
Server Error
TypeError: nextCallback is not a function
해결 방법(변경사항)
version 6.0.2 >
const getServerSideProps = wrapper.getServerSideProps(async (context) => {
context.store.dispatch(~~~);
context.store.dispatch(END);
await store.sagaTask.toPromise();
});
version 7.0.0 >
const getServerSideProps = wrapper.getServerSideProps(
(store) =>
async ({ req, res, ...etc }) => {
store.dispatch(~~~);
store.dispatch(END);
await store.sagaTask.toPromise();
}
);
추가적으로 동적라우팅 (강의 : 다이나믹 라우팅) 할 때도 (req, res, ...etc) > (req, res, params, ...etc) 로 수정하시면 됩니다.
next-redux-wrapper 참고 자료(getServerSideProps)
(https://github.com/kirill-konshin/next-redux-wrapper#getserversideprops)
변경사항
(https://github.com/kirill-konshin/next-redux-wrapper#upgrade-from-6x-to-7x)
답변을 작성해보세요.
1
NOAH
2021.06.30
문서를 다시 보고 해결하였습니다.. 아에 잘못 설정해놨네요. 혹시 문제 있으신분 참고하세요.
0
0
0
NOAH
2021.06.30
말씀해주신데로 적용했는데 data를 가져오질 못하네요.
0
답변 6