Paprofrontenddevlibbuild

Tell us what’s happening:
it says build error
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", "Cook", "Bake"]} />
      <List/>
      <h2>Tomorrow</h2>
      <List/>
      <List tasks={["Study", "Code", "Eat"]} />
    </div>
  );
}
}

  **Your browser information:**

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

Challenge: Pass an Array as Props

Link to the challenge:

1 Like

Hello there,

Please use descriptive titles for forum posts.


If you open your browser console, you will see this error:

TypeError: Cannot read property 'join' of undefined

As the issue is within this section:

<List tasks={["Walk", "Cook", "Bake"]} />
      <List/>
      <h2>Tomorrow</h2>
      <List/>
      <List tasks={["Study", "Code", "Eat"]} />

Can you see why props.tasks might be undefined?

Hope this helps

1 Like

can u identify it specifically unable to understand

There are four <List />s being called there. What is missing from two of them?

2 Likes

Thanks problem solved

1 Like