Paratron / hookrouter

The flexible, and fast router for react that is entirely based on hooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

External url navigation

Mrbeyond opened this issue · comments

Navigation to external url address or domain not working. Example the anchor or naviagte('https://google.com') does not route to the external url but keeps matching the pathname to the Internal routes. Please I really need help with this. Thanks in advance.

Hm, what did you expect? Calling navigate() passes an URL fragment to the router to match it. Its not supposed to get passed full urls with domain and everything.

Why don't you place a traditional <a> tag, if you want to create a link to another domain?

Okay, wait a sec. If you import the <A> component from hookrouter, that would not work with external URLs, because it passes everything to navigate.

If you want to create a link to another website, use the <a> component instead!

I am totally confused because it's not navigating to another website even with tag but only tries to match the href to the routes and if none is found the not found page declared is rendered. Can I share the code now please?

You should have been provided a code example on codesandbox.io in the first place so I can give any help at all :)

The is resolved.

Someone really needs someone to update the docs then. I assumed would also redirect not only to paths, but external urls.