dillon1000/react

Commit

Set owner correctly inside forwardRef and context consumer (#12777)

Previously, _owner would be null if you create an element inside forwardRef or inside a context consumer. This is used by ReactNativeFiberInspector when traversing the hierarchy and also to give more info in some warning texts. This also means you'll now correctly get a warning if you call setState inside one of these.

Test Plan: Tim tried it in the RN inspector.
Browse files
Changed paths1 file
First-parent comparison
M packages/react-reconciler/src/ReactFiberBeginWork.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…