The majority of cases should be addressed by default by this plugin.
In some cases, for example when using HOCs (High Order Components), like react-redux's connect, or component inheritance (although it's NOT recommended), a comment after the propTypes definition may be used to force the removal:
Accessing Component.propTypes.className will throw.
The wrap modes are targeting React libraries like material-ui or react-native-web.
They are not intended to be used by application authors.
true: the import statements are removed as well. This option only works if mode is set to remove:
import PropTypes from'prop-types'
false (default): does not remove the import statements.
This filter generates a regular expression.
Any filenames containing one of the array's strings will be ignored.
By default, we match everything.
Following the Is it safe? section, you might encounter a component
depending on the propTypes at runtime to work.
For this reason, we provide an array options to filter out some files and folders.
For instance, you can ignore all the npm modules:
This option gives the possibility to remove other propTypes in addition to the canonical prop-types.