Pass an Array as Props in React

Pass an Array as Props in React
0.0 0

#1

I know this problem is already mentioned but I can’t find the solution. I also fixed spaces in

tag but I am still having problem and getting the last error.
The List component should render the value from the tasks prop in the p tag.

Here is the code , please help, thanks

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={["one", "two"]}/>
        <h2>Tomorrow</h2>
        <List tasks={["one", "two", "three"]}/>
        { /* change code above this line */ }
      </div>
    );
  }
};

#2

There should be a space after the comma when you join the items. At the minute it will come back like “one,two,three” and it should be “one, two, three”


#3

It worked , thank you