2

I'm using the latest versions of react and semantic-ui-react

I have this Iconelement set up from semantic implementing navigation to an external link (github)

        <Menu.Item
          position="right"
          to="https://github.com"
          as={Link}
        >
          <Icon name="github" size="big" />
        </Menu.Item>

When I click the icon in my UI, it's trying to append the github url to the url of my UI. So I'm at localhost:blah/someUrl it's requesting localhost:blah/someUrl/https://github.com

Is this an issue with routing or misuse of the <Icon> props?

1 Answer 1

4

It's rather a misuse of router link: If you want to link to external pages, don't use routers <Link> component.

It will work the following way:

<Menu.Item
 href="https://github.com"
 position="right"
 target="_blank"
>
 <Icon name="github" size="big" />
</Menu.Item>
Sign up to request clarification or add additional context in comments.

1 Comment

ah yeah, I knew href was the answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.