@@ -594,21 +594,21 @@ React.createClass({
594594Let's say you are using bootstrap and want to get ` active ` on those ` li ` tags for the Tabs:
595595
596596``` js
597- import { Link , IndexLink , History } from ' react-router'
597+ import { Link , History } from ' react-router'
598598
599599const Tab = React .createClass ({
600600 mixins: [ History ],
601601 render () {
602- const isActive = this .history .isActive (this .props .to , this .props .query , this .props .indexLink )
602+ const isActive = this .history .isActive (this .props .to , this .props .query , this .props .onlyActiveOnIndex )
603603 const className = isActive ? ' active' : ' '
604- const LinkElement = this .props .indexLink ? IndexLink : Link;
605- return < li className= {className}>< LinkElement {... this .props }/ >< / li>
604+ return < li className= {className}>< Link {... this .props }/ >< / li>
606605 }
607606})
608607
609- // use it just like <Link/> or <IndexLink/>, and you'll get an anchor wrapped in an `li`
610- // with an automatic `active` class on both.
611- < Tab to= " /" indexLink> Home< / Tab>
608+ // Use it just like <Link/>, and you'll get an anchor wrapped in an `li` with
609+ // an automatic `active` class on both when appropriate. Add `onlyActiveOnIndex`
610+ // to trigger <IndexLink/> behavior.
611+ < Tab to= " /" onlyActiveOnIndex> Home< / Tab>
612612< Tab to= " about" > About< / Tab>
613613< Tab href= " foo" > Foo< / Tab>
614614```
0 commit comments