Tell us what’s happening:
Hello,
can anyone please clarify why my code is not acceptable outside the boundaries of the challenge itself?
If I had to render a component called CurrentDate holding the current date, I would like to give that property to the component and let the Parent only the display action. What’s the benefit or the logic of passing the variable to the Calendar component since the result is the same?
Thanks
Your code so far
const CurrentDate = (props) => {
return (
<div>
{ /* change code below this line */ }
<p>The current date is: {Date()}</p>
{ /* change code above this line */ }
</div>
);
};
class Calendar extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<h3>What date is it?</h3>
{ /* change code below this line */ }
<CurrentDate />
{ /* 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/84.0.4147.135 Safari/537.36.
Challenge: Pass Props to a Stateless Functional Component
Link to the challenge: