Describe the bug
A ref is unexpectedly null when using a particular JSX structure.
To Reproduce
Demo.
View the console. I see:
{phase: 1, oneRef: null, twoRef: div, threeRef: div}
{phase: 2, oneRef: div, twoRef: null, threeRef: div}
Expected behaviour
{phase: 1, oneRef: null, twoRef: div, threeRef: div}
{phase: 2, oneRef: div, twoRef: div, threeRef: div}
It's expected that oneRef is null in phase 1 (the element isn't rendered), but twoRef shouldn't be null in phase 2, as the element is rendered.
The bug seems to depend on a few things:
If <div class="wrapper"> is switched to a fragment, the bug still happens. However, if <div class="wrapper"> is removed, the bug does not happen.
If <div class="outer"> is switched to a fragment, the bug does not happen.
Describe the bug
A ref is unexpectedly null when using a particular JSX structure.
To Reproduce
Demo.
View the console. I see:
Expected behaviour
It's expected that
oneRefisnullin phase 1 (the element isn't rendered), buttwoRefshouldn't benullin phase 2, as the element is rendered.The bug seems to depend on a few things:
If
<div class="wrapper">is switched to a fragment, the bug still happens. However, if<div class="wrapper">is removed, the bug does not happen.If
<div class="outer">is switched to a fragment, the bug does not happen.