aichbauer/styled-bootstrap-components

Components should not rely on react-router-dom

Closed this issue · 6 comments

My project uses router5 with mobx, so this dependency means that styled-bootstrap-components is not compatible without rewriting the NavLink component.

Hey, thanks for your interest in this project.

So do you think we should only use the plain a tag? How would you use the NavLink in combination with any router?

I will take a look into it as soon as possible.

Also, Pull Requests are always welcome. If you already have solution that fits all needs, feel free to open a PR.

So I had time last night to play around with it. I do not know why I didn't came up with it in first place. But yeah its simple as

import { Link } from 'react-router-dom';
import { NavLink } from 'styled-nav-component';

const myComponent = (props) => (
  <div>
    {/* both of these work */}
    <NavLink><Link to="#"></Link></NavLink>
    <Link to="#"><NavLink></NavLink></Link>
  </div>
);

So we can get rid of it. I try do get it done as soon as possible. Maybe you have an more detailed example on how to use it with router5, then we could add this to the docs?