SIGN IN SIGN UP
facebook / react UNCLAIMED

The library for web and native user interfaces.

0 0 0 JavaScript

[compiler] ref guards apply up to fallthrough of the test

Fixes #30782

When developers do an `if (ref.current == null)` guard for lazy ref initialization, the "safe" blocks should extend up to the if's fallthrough. Previously we only allowed writing to the ref in the if consequent, but this meant that you couldn't use a ternary, logical, etc in the if body.
J
Joe Savona committed
be41c94e5cbd20df134bdbb6073d4dd5b44f6d8b
Parent: 6891dcb