dillon1000/react

Commit

[Fiber] Complete ES6 Class related errors support (#8156)

* Print a warning in fiber for lacking render method

* Reject initial non-object state in Fiber

Rejects Arrays, Strings & Numbers. Allows nulls.

* Centralize fiber checks on ES6 Classes

* Add classic & instance property checks on fiber

- check the absence of getInitialState & getDefaultProps as methods
- check the absence of propTypes & contextTypes at instance-level

* Convert to normalized React `warning` calls

* Support lifecycle typo detection in fiber

* Get the complete warnings from the existing code

* Only check classInstance once

Avoid rechecking while resuming

* Can warn component while resuming but only once

This is achieved by tracking the warning state in the Fiber structure.

* Remove warning deduplication

* Factor name retrieval in a getName helper

* Use invariant instead of throw

* Read inst.state only once for the invariant

* Fix condition on the instance state

* Register failing/passing fiber tests
Browse files
Changed paths3 files
First-parent comparison
M scripts/fiber/tests-failing.txt ModifiedM scripts/fiber/tests-passing.txt ModifiedM src/renderers/shared/fiber/ReactFiberClassComponent.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…