SIGN IN SIGN UP
facebook / react UNCLAIMED

The library for web and native user interfaces.

0 0 0 JavaScript

[compiler] Allow setStates in use{Layout,Insertion}Effect where the set value is derived from a ref (#34462)

@stipsan found this issue where the compiler would bailout on the
`useLayoutEffect` examples in the React docs. While setState in an
effect is typically an anti-pattern due to the fact that it hurts
performance through cascading renders, the one scenario where it _is_
allowed is if the value being set flows from a ref.

DiffTrain build for [835b00908b1b1c522323162b735a85c5f620ac81](https://github.com/facebook/react/commit/835b00908b1b1c522323162b735a85c5f620ac81)
P
poteto committed
0e51ebf78fd97a4bf4681967f80e730f7ff2e779
Parent: 97ab71a