Skip to content

Commit 360a00d

Browse files
committed
Add example to doc comment
1 parent 0813090 commit 360a00d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modules/mixins/ActiveState.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ var React = require('react');
33
/**
44
* A mixin for components that need to know the routes, URL
55
* params and query that are currently active.
6+
*
7+
* Example:
8+
*
9+
* var AboutLink = React.createClass({
10+
* mixins: [ Router.ActiveState ],
11+
* render: function () {
12+
* var className = this.props.className;
13+
*
14+
* if (this.isActive('about'))
15+
* className += ' is-active';
16+
*
17+
* return React.DOM.a({ className: className }, this.props.children);
18+
* }
19+
* });
620
*/
721
var ActiveState = {
822

0 commit comments

Comments
 (0)