React - Pass an Array as Props

Tell us what’s happening:
Describe your issue in detail here.

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 */ }
        <List/>
        <h2>Tomorrow</h2>
        <List tasks={["walk dog","workout"]}/>
        { /* Change code above this line */ }
      </div>
    );
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.124 YaBrowser/22.9.5.710 Yowser/2.5 Safari/537.36

Challenge: React - Pass an Array as Props

Link to the challenge:

Где у меня ошибка ?

Lists component have no props to render.
After fixing it you should be able to clear the challenge. :slight_smile:

вот он я его добавил или еще надо?

The <List /> component is used two times inside ToDo, make sure you give both of them props.

The first should be given at least 2 tasks (array with 2 elements) and the last at least 3 tasks (array with 3 elements).

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.