Skip to content

Investigate uncovered differences between development and production #11618

Closed
@gaearon

Description

@gaearon

Follow up from #11616.

Here's one I found. These two invariants:

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions