I’m working on the challenge: ‘React: Pass an Array as Props’
I cannot pass the last test:
The List
component should render the value from the tasks
prop in the p
tag.
Which makes it clear that I don’t really understand what the term ‘render’ means in this context. I have tried to use the keyword render in the ‘List’ component. That only made the entire thing stop working.
Code below.
{ /* 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={["walk dog ", " workout"]} />
<h2>Tomorrow</h2>
<List tasks={["What do you want to do tonight, Brain? " , " The same thing we do every night, Pinky ", " Try to take over The World."]} />
{ /* change code above this line */ }
</div>
);
}
};```
And Thanks!