Kaynağa Gözat

L9: IndexLink, onlyActiveOnIndex property.

Frederic G. MARAND 9 yıl önce
ebeveyn
işleme
64df944e17
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      modules/App.js

+ 2 - 2
modules/App.js

@@ -1,4 +1,4 @@
-import { Link } from "react-router";
+import { IndexLink, Link } from "react-router";
 import NavLink from './NavLink';
 import React from "react";
 
@@ -8,7 +8,7 @@ export default React.createClass({
       <div>
         <h1>React router tutorial</h1>
         <ul role="nav">
-          <li><Link to="/">Home</Link></li>
+          <li><NavLink onlyActiveOnIndex={true} to="/">Home</NavLink></li>
           <li><NavLink to="/about">About</NavLink></li>
           <li><NavLink to="/repos">Repos</NavLink></li>
         </ul>