React: Review Using Props with Stateless Functional Components - props is not defined

React: Review Using Props with Stateless Functional Components - props is not defined
0

#1

Hello, I am curious, what is wrong with my code? Looking into it for 30 min and seems like all is as should be, yet it won’t pass even first checkpoint.
Command line is saying props is not defined

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

Camper.defaultProps = {
  name: 'CamperBot'
};

Camper.propTypes = {name:PropTypes.string.isRequired };

Thank you


#2

First of all, Camper should be a Stateless Functional Component and not a normal React component. React component’s need to refer to this.props.name, where SFCs would just refer to props.name. Sounds like you need to review the difference between a regular React component and an SFC.