-
Notifications
You must be signed in to change notification settings - Fork 49.7k
Closed
Description
Follow up from #11616.
Here's one I found. These two invariants:
react/packages/react-reconciler/src/ReactFiberClassComponent.js
Lines 330 to 343 in 7e71273
| if (state && (typeof state !== 'object' || isArray(state))) { | |
| invariant( | |
| false, | |
| '%s.state: must be set to an object or null', | |
| getComponentName(workInProgress), | |
| ); | |
| } | |
| if (typeof instance.getChildContext === 'function') { | |
| invariant( | |
| typeof workInProgress.type.childContextTypes === 'object', | |
| '%s.getChildContext(): childContextTypes must be defined in order to ' + | |
| 'use getChildContext().', | |
| getComponentName(workInProgress), | |
| ); |
are in a function that's behind a DEV block:
react/packages/react-reconciler/src/ReactFiberClassComponent.js
Lines 447 to 449 in 7e71273
| if (__DEV__) { | |
| checkClassInstance(workInProgress); | |
| } |
I don't think this is intentional, but need to verify.
There may be more. I'll use this issue to track while #11616 preserves existing behavior.