no way to use Tab & TabLink with NavLink from 'react-router'
See original GitHub issue<Tab isActive>
<TabLink>Name</TabLink>
</Tab>
will generate:
<li class="is-active">
<a>Name</a>
</li>
But, NavLink
from react-router
can only add className to itself, if it’s active.
<NavLink to="/path" activeClassName="is-active" >Title</NavLink>
if we’re in /path
url, it will generate:
<a href="/path" class="is-active">Title</a>
So, even if we compose NavLink
& TabLink
, there’s still no way to use bulma
’s style with it. Because, we can’t add className to Tab
when NavLink
is active.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to lead a link click to common page & activate tab items ...
How to lead a link click to common page & activate tab items under React Router · click of Foundation Sub 1 should...
Read more >Handling Tabs Using Page URLs and React Router Doms
Learn how to maintain your active tab by using URL parameters and leveraging React Router Dom instead of using React state.
Read more >NavLink v6.6.1 - React Router
This is useful when building a navigation menu such as a breadcrumb or a set of tabs where you'd like to show which...
Read more >How to handle navigation in your app with React Router Link
The first two will use the Link and NavLink components, while the last one will make use of the Redirect component. Let's get...
Read more >Using the Link and NavLink Components to Navigate to a Route
React -Router provides the and components, which allow you to ... Navigation links created with <Link> and <NavLink> do not result in a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MunifTanjim , you’re right, there is no
easyway to useNavLink
, but remember that you haveLink
and you can use it like this example. This example is based on React Router custom link example.Since Bulma use this kind of classes for tabs, we’re unable to change the behavior. I’ve been really busy but I want to change this kind of stuff (since Bulma is not intended for React while Bloomer is ) and make Bloomer React friendly with other famous libraries,
styled-components
is going to help us to achieve this.Here you go: https://gist.github.com/pauleveritt/c5bc6d6f317daede74b97216294bb87f
I suspect the gist will be insufficient as well, as this is an interaction with react-router 4. Meaning, if I need to make a small repo, let me know.