[SOLVED]:Review Using Props with Stateless Functional Components- error last test case

Tell us what’s happening:
It fails the last test case- The Camper component should contain a p element with only the text from the name prop.

Your code so far


class CampSite extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <Camper name="CamperBot"/>
      </div>
    );
  }
};
// change code below this line
const Camper=(props) =>{

    return <p> {props.name} </p>;
  

Camper.defaultProps={
  name:'CamperBot'
}
Camper.propTypes={
  name:PropTypes.string.isRequired
}

};

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1 Safari/605.1.15.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/review-using-props-with-stateless-functional-components

Try removing the spaces in the <p> tags:

return <p>{props.name}</p>;
1 Like

Thanks a lot, It works. @kevcomedia