0

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

Michael JDI
  • 1,241
  • 5
  • 18
  • 30

1 Answers1

0

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

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

Michael JDI
  • 1,241
  • 5
  • 18
  • 30