인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

No author

This post's author information has been deleted.

Redux vs MobX (Learn Both!)

2-2. combineReducer

initialState

Written on

·

288

0

const initialState = {
  user: {
    isLoggingIn: true,
    data: null,
  },
  posts: [],
};

const store = createStore(reducer, initialState);

initialState를 쪼갰는데

굳이 index2.js에서 store만들 때 initialState가 또 왜 필요한지 궁금합니다.

실제로 지우고 해보니까 똑같이 잘돌아가더군요..

const store = createStore(reducer);

reduxmobx

Answer 1

0

zerocho님의 프로필 이미지
zerocho
Instructor

initialState가 없으면 ADD_POST 이런것부터 안 될 텐데요?

No author

This post's author information has been deleted.

Ask a question