M
M
myaca2017-10-18 02:09:20
JavaScript
myaca, 2017-10-18 02:09:20

How to make a redirect remember history in react-router-dom?

Depending on the state, I return in the render. But when redirecting itself, I have already switched to a new "page", if you press the back arrow in the browser, you get an empty page, and not the one from which I went here ... Why is this happening ? Or how to do a redirect, tell me <Redirect to={this.state.targetURL}/>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
myaca, 2017-10-18
@myaca

I don’t know how it’s right, but I found this option:
I added mb in the render before the redirect, who needs it {this.props.history.push("/")}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question