Tell us what’s happening:
The date
prop of the CurrentDate
should contain a string of text.
Isn’t the above statement(instruction) is misleading ? because my date property will look like below
<CurrentDate date={Date()}/>
I’m calling a JS Date object directly, I shouldn’t pass this as a string of text like
I’m just curious if there is any mistake in the instructions or may be I’m going wrong
Can someone please guide me ? Thanks !!
Your code so far
const CurrentDate = (props) => {
return (
<div>
{ /* change code below this line */ }
<p>The current date is:, {props.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 date={Date()}/>
{ /* 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/80.0.3987.87 Safari/537.36
.
Challenge: Pass Props to a Stateless Functional Component
Link to the challenge:
https://www.freecodecamp.org/learn/front-end-libraries/react/pass-props-to-a-stateless-functional-component