inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

KS Michael님의 게시글

KS Michael KS Michael

@hyeongkwangseok

수강평 작성수
-
평균평점
-

게시글 3

질문&답변

isServer error 에러가 나왔습니다 ㅠㅠ

@ant-design/compatible 추가 했더니 저는 getState 에러 나요. 그래서 공홈에 있는 antd-design/icon 4.1.0 으로 했습니다. 에러 안납니다. compatible는 왜? 에러나는지 모르겠네요...

좋아요수
0
댓글수
4
조회수
682

질문&답변

isServer error 에러가 나왔습니다 ㅠㅠ

1. npm i redux-devtools-extension 2. import composeWithDevTools from 'redux-devtools-extension' export default withRedux((initialState, options) => { const middlewares = []; const enhancer = composeWithDevTools(applyMiddleware(...middlewares)); const store = createStore(reducer, initialState, enhancer); return store; })(NodeBird); 이렇게 작성했더니 6.0.0 버전에서 잘 작동합니다. 아래 링크 참고했습니다. 참고

좋아요수
0
댓글수
4
조회수
682

질문&답변

isServer error 에러가 나왔습니다 ㅠㅠ

next-redux-wrapper 버전이 6버전까지 나왔습니다. 버전이 올라가면서 작동방식이 달라진것 같습니다. https://github.com/kirill-konshin/next-redux-wrapper#upgrade-from-5x-to-6x Major change in the way how things are wrapped in version 6. Default export withRedux is marked deprecated, you should create a wrapper const wrapper = createWrapper(makeStore, {debug: true}) and then use wrapper.withRedux(Page) . Your makeStore function no longer gets initialState , it only receives the context: makeStore(context: Context) . Context could be NextPageContext or AppContext or getStaticProps or getServerSideProps context depending on which lifecycle function you will wrap. Instead, you need to handle the HYDRATE action in the reducer. The payload of this action will contain the state at the moment of static generation or server side rendering, so your reducer must merge it with existing client state properly. App should no longer wrap its children with Provider , it is now done internally. isServer is not passed in context / props , use your own function or simple check const isServer = typeof window === 'undefined' or !!context.req or !!context.ctx.req . store is not passed to wrapped component props. WrappedAppProps was renamed to WrapperProps . 버전문제가 아닐까 추측할뿐 , 저도 아직 해결 하진 못했습니다.

좋아요수
0
댓글수
4
조회수
682