usePostFrameUpdateEffect function
Runs effect after a completed browser frame for updates, skipping the
frame that mounted the hook.
With omitted keys, it runs after every later client frame. With keys, it
runs after the frame in which their ordered contents changed. Effects and
cleanups are skipped during server and static rendering.
Implementation
void usePostFrameUpdateEffect(Dispose? Function() effect, [List<Object?>? keys]) {
final isInitialRun = useRef(true);
usePostFrameEffect(() {
if (isInitialRun.value) {
isInitialRun.value = false;
return null;
}
return effect();
}, keys);
}