dillon1000/react

Commit

Don't warn about class component usage of getInitialState if state is also set

We warn about getInitialState() usage in class components because users may have accidentally used it instead of state. If they have also specified state though then we should skip this warning.

Context: https://twitter.com/soprano/status/810003963286163456
Browse files
Changed paths6 files
First-parent comparison
M scripts/fiber/tests-passing.txt ModifiedM src/isomorphic/modern/class/__tests__/ReactCoffeeScriptClass-test.coffee ModifiedM src/isomorphic/modern/class/__tests__/ReactES6Class-test.js ModifiedM src/isomorphic/modern/class/__tests__/ReactTypeScriptClass-test.ts ModifiedM src/renderers/shared/fiber/ReactFiberClassComponent.js ModifiedM src/renderers/shared/stack/reconciler/ReactCompositeComponent.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…