Skip to content

It's not safe to read CurrentOwner.current and assume it has a stateNode #12299

@gaearon

Description

@gaearon

This:

ReactCurrentOwner.current = workInProgress;

might mean that _owner.stateNode is null.

So assumption like this leads to runtime failure in DEV:

owner.stateNode._warnedAboutRefsInRender;

We should fix up all such code sites.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions