Skip to content

Cannot read property 'location' of undefined #3

Description

@Zougheb

Hi Zaza,
I am coding along in part 1 and I got this issue when I run yarn start
TypeError: Cannot read property 'location' of undefined

Here is the home.jsx
import React, { PureComponent } from 'react';
import { Link } from 'react-router';

export default class Home extends PureComponent {
active(path) {
// Returns active when the path is equal to the current location
if (this.props.location.pathname === path) {
return 'active';
}
}
render() {
.....

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions