Let's say we have a class component named, Trees.
We can import proptypes as such.
import PropTypes from "prop-types"
Outside of component itself. Best for Functional Components.
Trees.propTypes = {
getTrees: PropTypes.func.isRequired,
treeItems: PropTypes.object
}Inside of component using, static.
static propTypes = {
getTrees: PropTypes.func.isRequired,
treeItems: PropTypes.object
}