Same statements getting errors

Tell us what’s happening:
Hey so i was trying to learn react but i am stuck on this issue The date prop should be generated by calling Date()
Here is the answer provided
<CurrentDate date={Date()} />
<CurrentDate date={(Date())} />

Here is what i am using(the second one)

Aren’t they the same?

  **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 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Challenge: Pass Props to a Stateless Functional Component

Link to the challenge:

What makes you think you need parentheses around the function call?

Anyway, the test is using a regex and (understandably) doesn’t expect the parentheses to be there.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.