Getting error while registering reducers using ActionReducerMap: "not assignable to type 'ActionReducerMap<AppState, Action>"
Your error message says that property post has the wrong method signature. It is (state: State, action: Action) => void
, but should be (state: State, action: Action) => State
.
In post.reducers.ts your reducer needs to return the state that is passed into it like this:
export function postReducer(state = initialPostState, action:Action) {
return state;
};
The return type is being implicitly inferred from what you are, or in this case aren't, returning.
You could explicitly state the return type with ...): State {...
but you should still return the state.