REACT JS Error
Guys why Do I get the Error Under My Function Parameter even if the result shows Up correctly
5 Replies
Hover over it
What does it say?
you might get some more info by clicking that link
he actually add a simple comment when trying to solve the problem But I think its not the best practice thou like overriding the error or disabling some functions
You forgot to import proptypes module
import PropTypes from 'prop-types';
And also there's no validation for the prop:
i.e:
Content.propTypes = {
creatorname: PropTypes.string.isRequired,
};
For more information on this you can read
https://react.dev/reference/react/Component#static-defaultpropsComponent – React
The library for web and native user interfaces