react-native-redux-toast
react-native-redux-toast copied to clipboard
TypeError: stat merge is not a function
I'm getting the following error:

Here is my code it's pretty much like the example Reducer Index
import { combineReducers } from 'redux';
// Import reducers
import routesReducer from './routesReducer';
import { reducer as navbarReducer } from './navbarReducers';
import { reducer as projectsReducer } from './projectsReducers';
import { reducer as teamsReducer } from './teamsReducers';
import { reducer as photosReducer } from './photosReducers';
import { reducer as photosCommentsReducer } from './photosCommentsReducers';
import { reducer as persistReducer } from './persistReducers';
import { reducer as connectionReducer } from './connectionReducers';
import { reducer as newDataReducer } from './newDataReducers';
import { reducer as functionReducer } from './functionsReducers';
import { reducer as userReducer } from './userReducers';
import { reducer as jwtReducer } from './jwtReducer';
import { reducer as resetPasswordReducer } from './resetPasswordReducer';
import { toastReducer as toast } from 'react-native-redux-toast';
export default combineReducers({
//Scenes,
toast,
routesReducer,
persist: persistReducer,
connectionStatus:connectionReducer,
navbar: navbarReducer,
selectedProject: projectsReducer,
selectedTeam: teamsReducer,
selectedTeamPhotos: photosReducer,
photosComments: photosCommentsReducer,
newData: newDataReducer,
functions:functionReducer,
user:userReducer,
jwt:jwtReducer,
resetPassword:resetPasswordReducer,
});
Calling the props
// Maps to props
const mapDispatchToProps = (dispatch) => {
return {
postEditComment: (data) => dispatch(photosCommentsActionCreators.photoEditComment(data)),
testing:() => dispatch(ToastActionsCreators.displayError('Error toast!'))
//this.props.dispatch(ToastActionsCreators.displayError('Error toast!'));
};
};
Getting the same problem. I think this library is making the assumption that the state is set up using ImmutableJS, resulting in this error when you are actually not using ImmutableJS.
I have the same problem.
I think this https://github.com/reactjs/react-router-redux/issues/441 would help you. Several things you need to update:
- import { combineReducers } from 'redux-immutable'; // not from 'redux'
- import { fromJS } from 'immutable' and convert the initialState to immutable object with fromJS()
- also call fromJS() each time you update state
- call state.get(reducerName) each time you need to get values, don't use 'state.key', I suggest you write your own util to handle conversion
I've forked this and removed redux-immutable. Here's a link for anyone that runs into this issue: https://github.com/PeterChauYEG/react-native-redux-toast