I know you can specify prop types in React, but can you specify only these prop types?
So in the code below name
is a required prop. But can I make a warning show if you pass an additional prop eg 'age' without specifying a prop type for this field?
My thinking is to ensure that I have 100% coverage for my prop types.
import PropTypes from "prop-types";
const Component = () => {
return (
// stuff
);
};
Choose.propTypes = {
name: PropTypes.string.isRequired,
};