The Component2.propTypes boilerplate was unnecessarily verbose.
Changes
Add a class that contains the metadata that was previously provided as separate arguments, and change the PropValidator typedef signature to only require two arguments - with the second argument being an instance of the metadata class.
Motivation
The
Component2.propTypes
boilerplate was unnecessarily verbose.Changes
Add a class that contains the metadata that was previously provided as separate arguments, and change the
PropValidator
typedef signature to only require two arguments - with the second argument being an instance of the metadata class.Before:
After:
Update JS interop to pass through the field values from the
ReactValidatorInfo
fields as individual arguments to the JSReact.propTypes
function.Update some dynamic call sites where they could be tightened to at least
Function
.Review
[See CONTRIBUTING.md][contributing-review-types] for more details on review types (+1 / QA +1 / +10) and code review process.
Please review: @greglittlefield-wf @joebingham-wk @kealjones-wk @sydneyjodon-wk
QA Checklist