React issue with Array type

React issue with Array type
0

In this lesson you got issue with JS Array type. It do not understand .join(’, ') as in array.

My solution:

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 */ }
          <List tasks={['some1', 'some2']} />
        <List/>
        <h2>Tomorrow</h2>
        <List tasks={['some1', 'some2', 'some3']} />
        { /* change code above this line */ }
      </div>
    );
  }
};

Lesson link: https://www.freecodecamp.org/learn/front-end-libraries/react/pass-an-array-as-props

I found the solution, there are one more component then needed