Sandbox: https://codesandbox.io/s/cranky-kapitsa-op3jh
Repro: type "a" and then after a second "b"
Expected: Eventually you'll see "ab" in all fields. Pending "..." indicator goes away.
Actual: You'll keep seeing "a" in low pri field. Pending "..." indicator is stuck.
Sandbox: https://codesandbox.io/s/nostalgic-gauss-xrn4o (If I understand problem correctly)
Why didn't you update mirror text with useEffect?
Generally saying, render phase updates are better for derived state because you don鈥檛 need an extra rendering pass for the whole subtree.
In either case, it doesn鈥檛 matter how else I could write it. The problem is that this uncovers a bug in React, and bugs need to be fixed.
Most helpful comment
Generally saying, render phase updates are better for derived state because you don鈥檛 need an extra rendering pass for the whole subtree.
In either case, it doesn鈥檛 matter how else I could write it. The problem is that this uncovers a bug in React, and bugs need to be fixed.