6 ms·
`bar` is 2 because `setFoo` does not update the value of `foo` until the next render
by UberMouse 2y ago
`bar` is 2 because `setFoo` does not update the value of `foo` until the next render
- ww520 2y agoWill bar become 20 eventually? In the next cycle perhaps? So there will be 3 cycles? 1: foo = 1, next(foo = 10) bar = undef, next(bar = 2) 2: foo = 10 bar = 2, next(bar = 20) 3: foo = 10 bar = 20 Does the above sound right?