React - Pass an Array as Props

Tell us what’s happening:

There is an error in the challenge, as the placing of the question mark isn’t explicit by the instructions. I just know it by experience:
const List = (props) => {
return <p>{props.tasks.join(', ')}</p> < – THIS FAILS
return <p>{props.tasks?.join(', ')}</p> < – THIS WORKS
};

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0

Challenge Information:

React - Pass an Array as Props

if it fails it’s because this one does not have any passed props, as such, props.tasks is undefined and gives a syntax error when you try to use join on it. Call List properly, which also is needed for intructions (and tomorrow's should have at least 3 tasks.)

using optional chaining means that not following instructions like this doesn’t cause a syntax error