Re:Two custom React hooks
by steve_adams_86 on Friday December 17, 2021 @10:16AM
(#29593252)
Before React 18, it was possible to get multiple renders depending on where your calls to set state occurred. Inside different event loops, async calls, etc would lead to multiple renders even if they all settled within a few ms of each other and before a render occurred. The batching algorithm wasn’t aware of each asynchronous context.
In React 18 I believe this is mostly fixed.