Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Hello I am creating the scoreboard app with React.

Everything works fine until I add the initial players.map arrow function step is implemented on line 52 (Players List comment). The scoreboard is supposed to show the name values under it using the player's array everything shows up when I inspect the element with dev tools until this step maybe it is something I am not catching watched the video 5x. https://teamtreehouse.com/library/iterating-and-rendering-with-map

const players = [ { name: "Guil", score: 50 }, { name: "Treasure", score: 85 }, { name: "Ashley", score: 95 }, { name: "James", score: 80 } ]; const Header = (props) => { return( <header> <h1>{props.title}</h1> <span className="stats">Player: {props.totalPlayers} </span> </header> ); }

const Player = (props) => { return( <div className="player"> <span className="player-name"> {props.name} </span> <Counter score={props.score} /> </div> ); }

const Counter = (props) => { return( <div className="counter"> <button className="counter-action decrement">-</button> <span className="counter-score">{props.score}</span> <button className="counter-action increment">+</button> </div> ); }

const App = (props) =>{ return( <div className="scoreboard"> <Header title="Scoreboard" totalPlayers={"1"}/>
// {Players List*/} {props.initialPlayers.map( player => <Player name={player.name} score={player.score} /> )}

      <Player name="Tyrique" score={20} /> 
      <Player name="Tyrique" score={30} /> 
      <Player name="Tyrique" score={10} /> 
      <Player name="Tyrique" score={15} /> 

      </div> ); } 

ReactDOM.render( <App initialPlayers={players} />, document.getElementById('root') );