question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to open link in new tab

See original GitHub issue

As **NavItem** has div element so we can not open link in new tab, is there anyway to convert div element to a

also I have tried **componentClass='a'** but it’s not working fine…!

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
clintdittocommented, Oct 14, 2019

here is a better solution

using withRouter add a onClick to the NavItem

onClick={() => { history.push('/admin-team') }}

this will allow you to use all the area in the nav item to click and change the route.

<NavItem 
    onClick={() => { history.push('/admin-team') }} 
    eventKey="devices" className="new-sidebar-item"
>
    <NavIcon>
        <i className="fa fa-fw fa-line-chart" style={{ fontSize: '1.75em', verticalAlign: 'middle' }} />
    </NavIcon>
    <NavText  style={{ paddingRight: 32 }} title="Devices">
        Team
    </NavText>
</NavItem>
0reactions
white105commented, Oct 23, 2019

yeah that’s not a good solution @clintditto

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Ways to Open a Link in a New Tab - How-To Geek
Ctrl + Click. The first method requires a keyboard and a mouse or trackpad. Simply press and hold the Ctrl key (Cmd on...
Read more >
How to Use HTML to Open a Link in a New Tab - freeCodeCamp
It's easy to use HTML to open a link in a new tab. You just need an anchor ( <a> ) element with...
Read more >
How to Open a New Tab When Clicking a Link in Google ...
To quickly open a link in a new tab on Google Chrome, hold down the control button while clicking on it with your...
Read more >
How to Force Your Browser to Open a Link in a New Tab
You can load any link in a new browser tab by clicking or tapping on it while holding down the Control key (Windows)...
Read more >
How to Make Links Open in a New Window or Tab
How to Open Hyperlinks in a New Browser Tab or Window ... The short answer is: just add a target="_blank" attribute to your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found