Workiva / react-dart

Dart Bindings for React JS
BSD 2-Clause "Simplified" License
413 stars 67 forks source link

Move Prop Validation to getDerivedStateFromProps #292

Closed sydneyjodon-wk closed 3 years ago

sydneyjodon-wk commented 3 years ago

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)

QA Instructions:

Please review: @greglittlefield-wf @joebingham-wk @aaronlademann-wf