dillon1000/react

Commit

Warn when defined methods are used in plain JS classes

In ReactClass we use early validation to warn you if a accidentally defined
propTypes in the wrong place or if you mispelled componentShouldUpdate.

For plain JS classes there is no early validation process. Therefore, we
wait to do this validation until the component is mounted before we issue
the warning.

This should bring us to warning-parity with ReactClass.
Browse files
Changed paths3 files
First-parent comparison
M src/classic/class/ReactClass.js ModifiedM src/core/ReactCompositeComponent.js ModifiedM src/modern/class/__tests__/ReactES6Class-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…