Skip to content
This repository has been archived by the owner on Mar 22, 2020. It is now read-only.

Redirect does not update Component #19

Open
xescuder opened this issue Aug 10, 2018 · 3 comments
Open

Redirect does not update Component #19

xescuder opened this issue Aug 10, 2018 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@xescuder
Copy link

I've tried to use push history and Redirect but the effect is always the same, location is changed on browser, but expected Component is not rendered (render method of previous url is called instead). I've tried to use withRouter in compose but also no effect.

App.js:

HomePage:
if (toEquity === true) {
let whereTo = '/equities/' + selectedSuggestion;
return
}

EquityPage is not rendered and not even his methods (componentDidMount, componentWillReceiveProps, ...)

Thanks in advance.

@xescuder
Copy link
Author

I think I've found the solution! If anyone is interested create at 'app.js', create a wrapper from App using withRouter.

import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import {push} from 'react-router-redux';

const AppComposed = withRouter(connect(null, {push})(App));

ReactDOM.render(

{/* /}



{/
*/}
,
MOUNT_NODE

@flexdinesh flexdinesh added the help wanted Extra attention is needed label Aug 16, 2018
@ray-delossantos
Copy link

@xescuder, i tried your fix and it doesn't work. The url change but no render of the switch route component.

@zhenujt
Copy link

zhenujt commented Feb 20, 2019

Redirect to login, login component does not render,I also encountered the same problem, how can I solve it?
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants