Open
Description
Hey Nick, I've tested your code with the implementation of index.js inside /reducers with:
import { combineReducers } from "redux";
import PostReducer from './PostReducer'
export default combineReducers({
PostReducer
})
And inside store.js:
import { createStore, applyMiddleware } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import thunkMiddleware from 'redux-thunk'
import reducer from './reducers/index';
export const initialState = {
posts: [],
userPost: ''
};
export const initStore = (initialState = initialState) => {
return createStore(reducer, initialState, composeWithDevTools(applyMiddleware(thunkMiddleware)))
};
I'm getting the following error:
No reducer provided for key "PostReducer" Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers. TypeError: Cannot read property 'map' of undefined
Thoughts about the problem?
Metadata
Metadata
Assignees
Labels
No labels