Pass an Array as props-ermmm...blank mind

Tell us what’s happening:

Your code so far


const List = (props) => {

return <p>{props.tasks.join(", ")}</p>;

};

class ToDo extends React.Component {
constructor(props) {
  super(props);
}
render() {
  return (
    <div>
      <h1>To Do Lists</h1>
      <h2>Today</h2>
      { /* change code below this line */ }
      <List tasks={["Jump", "Laugh", "Cry"]} />
      <h2>Tomorrow</h2>
      <List lists={["Love", "Code", "Smile"]}/>
      { /* change code above this line */ }
    </div>
  );
}
};

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:76.0) Gecko/20100101 Firefox/76.0.

Challenge: Pass an Array as Props

Link to the challenge:

What is wrong with my code? Thank you for helping.

The instructions tell you to pass in a tasks array. That means you need to name the property tasks. You have not done this for both of the lists.

1 Like

Whoops. :grimacing: :slightly_frowning_face: :grinning:

Got it! Thank you! :slightly_smiling_face: