App.js 445 B

123456789101112131415161718
  1. import React from 'react'
  2. import NavLink from './NavLink'
  3. export default React.createClass({
  4. render() {
  5. return (
  6. <div>
  7. <h1>React Router Tutorial</h1>
  8. <ul role="nav">
  9. <li><NavLink to="/" onlyActiveOnIndex>Home</NavLink></li>
  10. <li><NavLink to="/about">About</NavLink></li>
  11. <li><NavLink to="/repos">Repos</NavLink></li>
  12. </ul>
  13. {this.props.children}
  14. </div>
  15. )
  16. }
  17. })