Tell us what’s happening:
I am lost! Even after searching for solutions, I don’t understand the error.
Your code so far
import PropTypes from 'prop-types';
class CampSite extends React.Component {
constructor(props) {
super(props);
this.state = {
name: ""
}
}
render() {
return (
<div>
<Camper name="Geoffrey" />
</div>
);
}
};
// change code below this line
class Camper extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<p>{this.props.name}</p>
</div>
);
}
};
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) Ubuntu Chromium/67.0.3396.99 Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/review-using-props-with-stateless-functional-components