Tell us what’s happening:
even though I did everything I was asked, last check pint fails, which is:
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>
<p><Camper name="CamperBot"/></p>
</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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
.
Challenge: Review Using Props with Stateless Functional Components
Link to the challenge: