I am getting error, not during compilation, but in my browser,
I have attached the files here
message.js reducer file
import store from './index';
// ACTION TYPES
const FETCH_MESSAGES = "FETCH_MESSAGES";
// ACTIONS
export const fetchMessages = ( id ) => {
console.log(store.getState());
return {
type: FETCH_MESSAGES,
payload: id
}
}
// REDUCERS
export default function reducer( state = -1, action ) {
switch(action.type) {
case FETCH_MESSAGES :
return action.payload;
default:
return state;
}
}
index.js
import { createStore, combineReducers, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import chatReducer from './chat';
import messageReducer from './messages';
const reducer = combineReducers({
chatStore : chatReducer,
messageStore : messageReducer,
});
const store = createStore(reducer, applyMiddleware(thunk));
export default store;
Error Message
Scrrenshot of error message