React - Pass Props to a Stateless Functional Component

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

const CurrentDate = (props) => {
  return (
    <div>
      { /* Change code below this line */ }
      <p>The current date is: </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/104.0.5112.124 YaBrowser/22.9.5.710 Yowser/2.5 Safari/537.36

Challenge: React - Pass Props to a Stateless Functional Component

Link to the challenge:

Откуда тут появилось data?

  • The date prop should be generated by calling Date()

You add it using the Date() constructor as shown in the challenge text.

Note that for prop values to be evaluated as JavaScript, they must be enclosed in curly brackets, for instance date={Date()} .

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