Access Props Using this.props_help

Tell us what’s happening:
I don’t know what is wrong with my code? Its not working

Your code so far


class ReturnTempPassword extends React.Component {
  constructor(props) {
    super(props);

  }
  render() {
    return (
        <div>
            { /* change code below this line */ }
            <p>Your temporary password is: <strong>     {this.props.tempPassword}</strong></p>
            { /* change code above this line */ }
        </div>
    );
  }
};

class ResetPassword extends React.Component {
  constructor(props) {
    super(props);

  }
  render() {
    return (
        <div>
          <h2>Reset Password</h2>
          <h3>We've generated a new temporary password for you.</h3>
          <h3>Please reset this password from your account settings ASAP.</h3>
          { /* change code below this line */ }
            <ReturnTempPassword tempPassword = 'jasveers' />
          { /* change code above this line */ }
        </div>
    );
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36 Avast/74.0.1376.132.

Link to the challenge:

Nothing is wrong with your code, the problem is with the test. In order to pass the test there should be no whitespace between the opening and closing tags of strong, like this:
<strong>{this.props.tempPassword}</strong>
The reason your code is not passing the tests is because of the whitespace after the opening strong tag.

1 Like