React Starter Tutorial

Created for CSE 370

Getting Started

Part 1
Part 2
Part 3
Part 4
Part 5
Part 6
React Routing
Styling the navbar
Part 9
Part 10
Part 11
Part 12
Part 13
Part 14
Conclusion

Additional Resources

W3Schools React Tutorial
Official ReactJS Tutorial
ReactJS Documentation

Routing and Navigation

Connecting the router to your navbar

You might be familiar with the classic <a> tag from standard html. react-router uses something called a link tag to do exactly what an <a> tag does. In order to finish our navbar, we’re going to need to add some link tags to the NavBar component. Head over to navbar.js and replace the stuff inside your <ul> tags to render the following:

          <nav>
            <ul>
                <li><Link to="/">Home</Link></li>
                <li><Link to='/register'>Register</Link></li>
                <li><Link to='/login'>Log In</Link></li>
            </ul>
            </nav>

Now, each list item will serve as a link. When the user clicks on a menu-item, a request will be made to render the component tied to the path specified.

Now your navigation bar works as expected!! The next step to this app is building login and signup, so that’s what we’re going to build in the next section.

Part 11 ->