There's a component on '/example' route. When I navigate to that path, the component being rendered. The problem is that I need to ignore rendering component and get redirected to the external link (which happen to have the same route) - '/example'. Is there any way for me to ignore or get around react-router route?
2 Answers
Here's a one-liner for using React Router to redirect to an external link:
<Route path='/privacy-policy' component={() => {
window.location.href = 'https://example.com/1234';
return null;
}}/>
1 Comment
Brent Thoenen
Using React, and implementing multiple sso providers configured via Spring Security 5, This was a working solution i could find to get around reactRouter and hit my backend oauth2 endpoints. thanks for the info!
<a ...></a>instead of<Link>