Comments (8)
Can you provide a code example?
from react-router-bootstrap.
yes, though In this case it's tested with ButtonLink. Apologies if I got something wrong.
The below adds the active class to the route when using ButtonLink, but when it's changed to this:
var MyLink = ReactRouterBootstrap.MenuItemLink;
it does not.
var React = require('react'), Router = require('react-router');
var ReactRouterBootstrap = require('react-router-bootstrap')
var RouteHandler = Router.RouteHandler, Route = Router.Route;
var ReactBootstrap = require('react-bootstrap');
var MyLink = ReactRouterBootstrap.ButtonLink;
var NavBar = React.createClass({
render: function(){
return (
<div>
<nav id="navbar">
<ul id="nav-pages">
<MyLink to="/">Home</MyLink>
<MyLink to="/about">About</MyLink>
<MyLink to="/contact">Contact</MyLink>
</ul>
</nav>
<RouteHandler />
</div>
);
}
});
var home = React.createClass({ render: function() { return (<div>Hi</div>); } });
var App = NavBar;
var routes = (
<Route handler={App} path="/">
<Route name="/" path="/" handler={home} />
</Route>
);
Router.run(routes, function (Handler) {
React.render(<Handler/>, document.body);
});
from react-router-bootstrap.
And which version of react-router-bootstrap are you using?
from react-router-bootstrap.
I'm using "react-router-bootstrap": "^0.8.0"
from react-router-bootstrap.
Looks like I had a bad unit test: https://github.com/mtscout6/react-router-bootstrap/blob/3f6ec7806454ed8e1a7a22a2236681103222c917/tests/MenuItemLink.spec.js#L62-L67
from react-router-bootstrap.
Version 0.8.1 is out with the fix.
from react-router-bootstrap.
Thank you! that fixes it.
from react-router-bootstrap.
No problem, thanks for reporting it.
from react-router-bootstrap.
Related Issues (20)
- `LinkContainer` turns all children's tags into `a`'s. HOT 1
- Why is this not part of react-bootstrap? I would prefer not to do a separate install. HOT 1
- LinkContainer to={..} does not read state variable
- Could not load react-router-dom
- react-router-dom v 6.x? HOT 18
- LinkContainer does not work in router-dom v6 HOT 1
- react-router-bootstrap LinkContainer wrapping a Nav.Link incompatible with latest react-router-dom v.6.0.2 HOT 3
- LinkContainer doesn't actually support NavLink props (className, style) HOT 2
- uhh..types? HOT 2
- Importing react-router-bootstrap includes all of lodash HOT 1
- Dependency Dashboard
- Support for Next.js?
- LinkContainer requires pathname in 'to' object. Link does not. HOT 1
- LinkContainer does not pass along "state" property
- Crashing randomly on dev - useNavigate() may be used only in the context of a <Router> component HOT 2
- Can't use search params in LinkContainer to prop HOT 1
- Standard <Link> tag loose active class while selecting bootstrap dropdown option
- 'LinkContainer' cannot be used as a JSX component. Its type 'LinkContainer' is not a valid JSX element type.
- Doesn't work for forms
- Remove defaultProps from all the components HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-router-bootstrap.