Pass an Array as Props my code is wrong?

Pass an Array as Props my code is wrong?
0

#1

Tell us what’s happening:

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={["Like rectt", "OOFTHEWAy"]} />
        <h2>Tomorrow</h2>
        <List tasks={["lol", "dogs", "baconlol"]} />
        { /* 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/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/pass-an-array-as-props


#2

There are two problems with the above line of code.

  1. You must enclose JavaScript code with { }

  2. Your join is not quite correct. Look carefully at the join separator and you should see your typo.


#3

so its { <p>props.tasksjoin(',')


#4

No, <p> is html and not JavaScript code.

Also, now you are missing a dot between tasks and join and your join separator string is still not correct.


#5

const List= (props) => {
{ /* change code below this line / }
return

{props.tasks.join(’, ')}


{ /
change code above this line */ }
};


#6

Thanks i think i got it now im just a big noob