Help me with this challenge: Pass an Array as Props

Tell us what’s happening:
Every time run the Test, is shows says this below:
// The second List component representing the tasks for tomorrow should have 3 or more items.

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>
        <List tasks={["walk dog", "workout"]}/>
        <List tasks={["walk dog", "workout"]}/>
        <List tasks={["walk dog", "workout"]}/>
        <h2>Tomorrow</h2>
        <List tasks={["Study", "Code", "Eat"]}/>
        <List tasks={["Study", "Code", "Eat"]}/>
        <List tasks={["Study", "Code", "Eat"]}/>
        <List tasks={["Study", "Code", "Eat"]}/>
      </div>
    );
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36.

Link to the challenge:

So a small issue: you should only have one List element under today, and one under tomorrow:

      <div>
        <h1>To Do Lists</h1>
        <h2>Today</h2>
        <List tasks={["walk dog", "workout"]}/>
        <h2>Tomorrow</h2>
        <List tasks={["Study", "Code", "Eat"]}/>
      </div>

Now, the tasks array property for Tomorrow contains three tasks. But how many tasks members are there in the List for Today?

Damn! I feel bad that I even ask. So It was not a code error but I misread the instructions. I will be more focused next time. Thanks for the help @snowmonkey

1 Like

Easy to overthink things like this. You’re doing great, and keep it up!