Skip to content

Instantly share code, notes, and snippets.

@nnarhinen
Created October 26, 2014 18:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nnarhinen/8cff16997228ac2d285e to your computer and use it in GitHub Desktop.
Save nnarhinen/8cff16997228ac2d285e to your computer and use it in GitHub Desktop.
/**
* @jsx React.DOM
*/
var React = require('react'),
ReactRouter = require('react-router'),
ActiveState = ReactRouter.ActiveState,
Link = ReactRouter.Link;
var MenuItem = module.exports = React.createClass({
mixins: [ActiveState],
render: function() {
var className = this.isActive(this.props.to, this.props.params, this.props.query) ? 'active' : '';
var link = Link(this.props);
return <li className={className}>{link}</li>;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment