Pass an Array as Props - suggestions!

Pass an Array as Props - suggestions!
0.0 0

#1

Tell us what’s happening:

I’m a little lost with this one, any guidance would be greatly appreciated!

Your code so far


const List= (props) => {
  { /* change code below this line */ }
  return <p>{props.tasks.join(", ")}</p>
  { /* change code above this line */ }
};

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 */ }
        <p>tasks={["Work Out", "Read"]}</p>
        <List/>
        <h2>Tomorrow</h2>
        <List/>
        <p>tasks={["Practice", "Teach", "Lunch"]}</p>
        { /* change code above this line */ }
      </div>
    );
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/pass-an-array-as-props


#2

Take a careful look at the components ToDo uses. There are two <List />s. Each one should receive a prop called tasks, which is an array of strings.


#3

My bad:
<List tasks={[“Work Out”, “Read”]}/>

Tomorrow


<List tasks={[“Practice”, “Teach”, “Lunch”]}/>

Thanks!