Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Router Basics Navigating and Nesting Routes Setting Active Links

bundle.js:36219 Uncaught ReferenceError: Navlink is not defined

Question: Console is giving me: Uncaught ReferenceError: Navlink is not defined Why do I only get the green background? And how come it is not defined? I have followed the instruction step by step, even checked if my code matches up to that of the tutorial, and it does. Where should I look for the error?

// App.js:

import React, { Component } from 'react';
import NavLink from './NavLink';

class App extends Component {
  render() {
    return (
      <div className="container">
        <header>
          <span className="icn-logo"><i className="material-icons">code</i></span>
          <ul className="main-nav">
            <li><NavLink to="/">Home</NavLink></li>
            <li><NavLink to="/about">About</NavLink></li>
            <li><NavLink to="/teachers">Teachers</NavLink></li>
            <li><NavLink to="/courses">Courses</NavLink></li>
          </ul>
        </header>
        { this.props.children }
      </div>
    );
  }
}

export default App;

// NavLink.js:



import React from 'react';
import { Link } from 'react-router';

const NavLink = props => (
  <Link {...props} activeClassname="active" />
);

export default Navlink;

'''

2 Answers

Hi Julian,

At the bottom of NavLink.js, in your export statement, you did not capitalize the 'L' in NavLink. It should be:

export default NavLink;

Notice the capital 'L'. Those small errors are a pain! Hopefully that gets it working for you.

Happy coding.
Leslie

Thank you so much... I've been staring down on my code for 1 hour. It fixed my problem obviously :P