Tell us what’s happening:
I tried to run the Test when it’s said not correct altough i use the same code on the solution from hint, it seems like a bug or something i tried to run it after few days and still got the error code on log
-
Failed:1. The
Calendar
component should return a singlediv
element. -
Failed:2. The second child of the
Calendar
component should be theCurrentDate
component. -
Failed:3. The
CurrentDate
component should have a prop calleddate
. -
Failed:4. The
date
prop of theCurrentDate
should contain a string of text. -
Passed:5. The
date
prop should be generated by callingDate()
-
Passed:6. The
CurrentDate
component should render the value from thedate
prop in thep
tag.
but when i change the code on
<CurrentDate date={Date ()} />
to
<CurrentDate date='the date' />
the test came back like this
-
- The
Calendar
component should return a singlediv
element.
- The
-
Passed:2. The second child of the
Calendar
component should be theCurrentDate
component. -
Passed:3. The
CurrentDate
component should have a prop calleddate
. -
Passed:4. The
date
prop of theCurrentDate
should contain a string of text. -
Failed:5. The
date
prop should be generated by callingDate()
-
Passed:6. The
CurrentDate
component should render the value from thedate
prop in thep
tag.
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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Challenge Information:
React - Pass Props to a Stateless Functional Component