dillon1000/react

Commit

Stack and Fiber warn about missing getChildContext method

Previous (probably unintentional) behavior of Stack was to allow components to define childContextTypes without also supplying a getChildContext property. This PR updates Fiber to (temporarily) mimic that behavior. It also adds warning messages to both Fiber and Stack (along with a test).

For the time being, Fiber components with a missing getChildContext method will return the parent context as-is, after warning.
Browse files
Changed paths5 files
First-parent comparison
M scripts/fiber/tests-passing.txt ModifiedM src/isomorphic/classic/__tests__/ReactContextValidator-test.js ModifiedM src/renderers/shared/fiber/ReactFiberContext.js ModifiedM src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js ModifiedM src/renderers/shared/stack/reconciler/ReactCompositeComponent.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…