When prop validation is performed in render, prop type errors won't be logged if an error is thrown before the component renders. To keep the same behavior of logging prop type errors even if the component throws when rendered, we need to move prop validation to getDerivedStateFromProps. (See conversation here for background)
When prop validation is performed in
render
, prop type errors won't be logged if an error is thrown before the component renders. To keep the same behavior of logging prop type errors even if the component throws when rendered, we need to move prop validation togetDerivedStateFromProps
. (See conversation here for background)QA Instructions:
over_react
test branchweb_skin_dart
test branchPlease review: @greglittlefield-wf @joebingham-wk @aaronlademann-wf