React - Review Using Props with Stateless Functional Components

Tell us what’s happening:

I want to get some details,please! Am stacked for the reason I don’t know.I stacked in
The lesson called Review Using Props with Stateless Functional Components.

Your code so far

import React from ‘react’;
import PropTypes from ‘prop-types’;

class CampSite extends React.Component {
render() {
return (




);
}
}

class Camper extends React.Component {
render() {
return (


{this.props.name}



);
}
}

// Setting defaultProps for the Camper component
Camper.defaultProps = {
name: ‘CamperBot’
};

// Defining propTypes for the Camper component
Camper.propTypes = {
name: PropTypes.string.isRequired
};

export default CampSite;

import React from 'react';
import PropTypes from 'prop-types';

class CampSite extends React.Component {
  render() {
    return (
      <div>
        <Camper name="CamperBot" />
      </div>
    );
  }
}

class Camper extends React.Component {
  render() {
    return (
      <div>
        <p>{this.props.name}</p>
      </div>
    );
  }
}

// Setting defaultProps for the Camper component
Camper.defaultProps = {
  name: 'CamperBot'
};

// Defining propTypes for the Camper component
Camper.propTypes = {
  name: PropTypes.string.isRequired
};

export default CampSite;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0

Challenge Information:

React - Review Using Props with Stateless Functional Components

Hi @surafel1

You don’t need to import or export anything, this is done in the background.

Happy coding