Skip to content

Commit

Permalink
Add example to doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Oct 7, 2014
1 parent 0813090 commit 360a00d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/mixins/ActiveState.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ var React = require('react');
/**
* A mixin for components that need to know the routes, URL
* params and query that are currently active.
*
* Example:
*
* var AboutLink = React.createClass({
* mixins: [ Router.ActiveState ],
* render: function () {
* var className = this.props.className;
*
* if (this.isActive('about'))
* className += ' is-active';
*
* return React.DOM.a({ className: className }, this.props.children);
* }
* });
*/
var ActiveState = {

Expand Down

0 comments on commit 360a00d

Please sign in to comment.