Skip to content
This repository has been archived by the owner. It is now read-only.
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
modules Change tutorial structure to individual folders for each lesson Mar 8, 2016
README.md Minor grammar fixes (#216) Aug 23, 2016
index.html
index.js Change tutorial structure to individual folders for each lesson Mar 8, 2016
package.json Change tutorial structure to individual folders for each lesson Mar 8, 2016
webpack.config.js Change tutorial structure to individual folders for each lesson Mar 8, 2016

README.md

Navigating with Link

Perhaps the most used component in your app is Link. It's almost identical to the <a/> tag you're used to except that it's aware of the Router it was rendered in.

Let's create some navigation in our App component.

// modules/App.js
import React from 'react'
import { Link } from 'react-router'

export default React.createClass({
  render() {
    return (
      <div>
        <h1>React Router Tutorial</h1>
        <ul role="nav">
          <li><Link to="/about">About</Link></li>
          <li><Link to="/repos">Repos</Link></li>
        </ul>
      </div>
    )
  }
})

Now visit http://localhost:8080 and click the links, click back, click forward. It works!


Next: Nested Routes

You can’t perform that action at this time.