**I am not understanding how can we use the date into the child functional component? Why we are not only writing props why we are writing props.date? I tried printing both and got similar value from both **
Your code so far
const CurrentDate = (props) => {
return (
<div>
{ /* change code below this line */ }
<p>The current date is:{props} </p>
{ /* change code above this line */ }
</div>
);
};
class Calendar extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
{console.log(props)}
{console.log(props)}
{console.log(props.date)
}
<h3>What date is it?</h3>
{ /* change code below this line */ }
<CurrentDate date={Date()}/>
{ /* change code above this line */ }
</div>
);
}
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36
.
Challenge: Pass Props to a Stateless Functional Component
Link to the challenge: