Notistack - withRouter and withSnackbar - How?

326 Views Asked by At

How do I combine the withSnackbar with withRouter?

const mapStateToProps = (state, props) => { return { loggedIn: state.loginReducer.loggedIn }; };

export default withRouter(connect(mapStateToProps, null)(DbPaper));

THIS DOES NOT WORK export default withRouter(withSnackbar(DbPaper), connect(mapStateToProps, null)(DbPaper));

any help is appreciated. Thanks

1

There are 1 best solutions below

0
On

compose from redux allowed me to add multiple items. import { compose } from "redux";

export default compose( withRouter, withSnackbar, connect(mapStateToProps, null) )(DbPaper);