sbalay / react-native-redux-toast

Simple to use, easy to customize Toast component for Android & iOS. Developed with love for redux apps
50 stars 21 forks source link

Doesn't work with redux-immutable #15

Closed jjant closed 2 years ago

jjant commented 6 years ago

You should probably allow a state prop instead of hardcoding your mapStateToProps function in the toast container.

That way you could do something like

import { compose } from 'redux';
import { toastReducer as toast } from 'react-native-redux-toast';

export const reducer = compose(fromJS, toast);

// ...

const App = ({ state }) => (
    <View>
        <Toast state={state.get('toast').toJS()} />
    </View>
);

And it would work with Immutablejs.