From 949974e3edc11ffb144ead7f8a5f70d93e532e3c Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Wed, 27 Jun 2018 16:35:52 +0200 Subject: Move callbacks to mapDispatchToProps --- src/client/react/components/container/WeekSelector.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client/react/components/container/WeekSelector.js') diff --git a/src/client/react/components/container/WeekSelector.js b/src/client/react/components/container/WeekSelector.js index 19a3947..f927117 100644 --- a/src/client/react/components/container/WeekSelector.js +++ b/src/client/react/components/container/WeekSelector.js @@ -81,9 +81,12 @@ class WeekSelector extends React.Component { } } -const mapStateToProps = (state, { location, history }) => ({ +const mapStateToProps = (state, { location }) => ({ week: weekFromLocation(location), +}); + +const mapDispatchToProps = (dispatch, { location, history }) => ({ setWeek: makeSetWeek(location, history), }); -export default withRouter(connect(mapStateToProps)(WeekSelector)); +export default withRouter(connect(mapStateToProps, mapDispatchToProps)(WeekSelector)); -- cgit v1.1