瀏覽代碼

L9: IndexLink, onlyActiveOnIndex property.

Frederic G. MARAND 9 年之前
父節點
當前提交
64df944e17
共有 1 個文件被更改,包括 2 次插入2 次删除
  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>