I'm new on using ReactJS and I want to know how to redirect after success from ajax call using React without react-route or flux ? Is that possible ? Can someone help me please
Asked
Active
Viewed 853 times
2 Answers
0
You can change window.location.href in your ajax callback to redirect browser to a new url.

Areca
- 1,292
- 4
- 11
- 21
0
I've not played much with React with React-routes. But You can use JS version.
// similar behavior as an HTTP redirect
window.location.replace("http://stackoverflow.com");
// similar behavior as clicking on a link
window.location.href = "http://stackoverflow.com";
Source from LINK