Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save prionkor/c1c25b2ca6ddd193271ea944ec792b11 to your computer and use it in GitHub Desktop.
Save prionkor/c1c25b2ca6ddd193271ea944ec792b11 to your computer and use it in GitHub Desktop.
React Router <Link />
# gets error
let listItems = course.acf.videos.map(function(video){
return <li key={video.ID}>
<Link
to="/test"
activeClassName="active"
>video.post_title</Link>
</li>;
});
return <ul>{listItems}</ul>;
# no errors
let listItems = course.acf.videos.map(function(video){
return <li key={video.ID}>{video.post_title}</li>;
});
return <ul>{listItems}</ul>;
@prionkor
Copy link
Author

prionkor commented May 4, 2017

Error is

React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of `Course`.

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