I'm using react-router-redux and I have a route like this
<Route path="/user/:userId" components={{ body: UserMaintenance }} />
Whats the recommended way to load user object corresponding to the userId parameter in the route?
My thoughts (I'm new to react & redux) would be to use the userId parameter in the UserMaintenance componentWillReceiveProps
method and dispatch a FETCH_USER
action to the store which will load into state.currentUser
. The UserMaintenance component would then update when the currentUser parameter is updated as a result of the action.