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 trialLuke Markham
Front End Web Development Techdegree Graduate 17,289 PointspropTypes
I have a issue my eslint is throwing up over "title" & "totalPlayers" props
Says "title/totalPlayers missing in props validation"
What could I do to validate them ?
const Header = props => {
const { title, totalPlayers } = props;
return (
<header>
<h1>{title}</h1>
<span className="stats">{totalPlayers}</span>
</header>
);
};
1 Answer
travis halarewich
9,165 PointsNot 100% if this will fix your issue but you don't have parenthesis for your arrow function. I would try this const Header = (props) => { return ( <header> <h1>{props.title}</h1> <span className="stats">{props.totalPlayers}</span> </header> ); }
Luke Markham
Front End Web Development Techdegree Graduate 17,289 PointsLuke Markham
Front End Web Development Techdegree Graduate 17,289 PointsThanks for your reply - parenthesis are not needed for arrow functions with one parameter