You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an application where we use <Link> extensively. We embed fragments of this app in external custom sites, using scripts or iframes. In that case, the fragment will use <Link>, but there will be no router, since the whole app isn't running; we don't control the page itself, so we can't install any routing, use pushState() etc.
Unfortunately, it looks like <Link> will always involve the routing machinery, even if there is no connection between the environment and a router. I could install a custom environment that simply set window.location, but that seems like an awkward solution for something that should be simple: When there is no routing going on, <Link> should simply behave like <a>.
The text was updated successfully, but these errors were encountered:
Not sure what you mean by "other projects". There is just one app. Currently we use our own custom Link component that detects whether routing is currently available, and uses <a> otherwise. But this should be unnecessary.
"Other projects" => "external custom sites". Sounds like you're already covered with your Link component. Could you take the logic from your custom Link, paste it into the main Link, and make a Pull Request?
No, my custom link component depends on a global boolean in my app, set at start time — it has no idea whether routing has actually been set up inside react-router-component.
We have an application where we use
<Link>
extensively. We embed fragments of this app in external custom sites, using scripts or iframes. In that case, the fragment will use<Link>
, but there will be no router, since the whole app isn't running; we don't control the page itself, so we can't install any routing, usepushState()
etc.Unfortunately, it looks like
<Link>
will always involve the routing machinery, even if there is no connection between the environment and a router. I could install a custom environment that simply setwindow.location
, but that seems like an awkward solution for something that should be simple: When there is no routing going on,<Link>
should simply behave like<a>
.The text was updated successfully, but these errors were encountered: