Tell us what’s happening:
It tells me its not rendering im not sure why? it is isnt it? The List
component should render the value from the tasks
prop in the p
tag. can someone please help thanks
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={["code", "workout", "machine", "babyy"]} />
<h2>Tomorrow</h2>
{ /* Pass tasks prop to List component */ }
<List tasks={["code", "workout", "machine", "babyy"]} />
{ /* 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/112.0.0.0 Safari/537.36 Edg/112.0.1722.64
Challenge: React - Pass an Array as Props
Link to the challenge: