We are using React + React-Redux + Redux-Saga in our application, and the withRouter
part of react-router-dom
is used when connecting to the redux store.
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(App));
Issue Steps:
- I have all users listed on the users landing page.
- I click on one of the users, then the redirect happens using the
withRouter
,history.push
function, which kicks the redirect onthis.props.history.push(${REDIRECT_URL});
, this shows the current clicked user-profile data. - Now I come back to the users landing page
- I click on another user, it again kicks in the
this.props.history.push(${REDIRECT_URL});
, and the previously visited users data is shown in a blink of an eye or some milliseconds, and then the newly clicked user-profile data is shown.
reduxForm
connected for my application is below
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(reduxForm({
form: 'userProfile', // this form needs to be fixed I guess with passing other `(k,v)` to the `reduxForm`
enableReinitialize: true,
})(UserInformation)));
Is there a way to fix this? to not show the previously visited users data? Appreciate help or pointers.