In React class components with mapStateToProps, mapDispatchToProps
every incoming state/dispatch prop is easy to type check with PropTypes.
When rewriting mapStateToProps -> useSelector
, and mapDispatchToProps -> useDispatch
I no longer see any logical place to do proptype checking. Unless I manually check proptypes with PropTypes.checkPropTypes()
.
I guess it's more important to do proptype checks of props from parent components than from Redux, but I would still like to know if anyone has a good solution.