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 trialXayaseth Boudsady
21,951 PointsIf you're using newer React instead for this video...tread carefully
For this course, I've been running to a lot of landmines since I'm following along in my local dev environment. Just a couple of key little things I've noticed since my console is always riddled with error when following step by step.
In the index.html I'm using the newer React, I believe the video is using 15.0.2, so I had to include the prop-types.js
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.4.1/umd/react.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.1/umd/react-dom.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prop-types/15.6.2/prop-types.js"></script>
As for the JS, the video is using
Application.propTypes = {
title: React.PropTypes.string,
players: React.PropTypes.arrayOf(React.PropTypes.shape({
name: React.PropTypes.string.isRequired,
score: React.PropTypes.number.isRequired,
})).isRequired,
};
For the new version you'll need to omit the "React" part of the .PropTyes
Application.propTypes = {
title: PropTypes.string,
players: PropTypes.arrayOf(PropTypes.shape({
name: PropTypes.string.isRequired,
score: PropTypes.number.isRequired,
})).isRequired,
};
Just a few things I noticed which was really bugging me since each time following the video I'm running into errors. Just FYI for those using the newer stuff, outside of workspace.
1 Answer
jacobproffer
24,604 PointsThanks for the heads up, Xayaseth!