Giter Club home page Giter Club logo

Comments (8)

mtscout6 avatar mtscout6 commented on September 1, 2024

Can you provide a code example?

from react-router-bootstrap.

vid avatar vid commented on September 1, 2024

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.

mtscout6 avatar mtscout6 commented on September 1, 2024

And which version of react-router-bootstrap are you using?

from react-router-bootstrap.

vid avatar vid commented on September 1, 2024

I'm using "react-router-bootstrap": "^0.8.0"

from react-router-bootstrap.

mtscout6 avatar mtscout6 commented on September 1, 2024

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.

mtscout6 avatar mtscout6 commented on September 1, 2024

Version 0.8.1 is out with the fix.

from react-router-bootstrap.

vid avatar vid commented on September 1, 2024

Thank you! that fixes it.

from react-router-bootstrap.

mtscout6 avatar mtscout6 commented on September 1, 2024

No problem, thanks for reporting it.

from react-router-bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.