You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checking goNextStatus() in useVisibleStatus.ts,
the source code look like this, for the switch condition, should we use prev instead of status?
function goNextStatus(callback?: () => void) {
cancelRaf();
rafRef.current = raf(() => {
// Only align should be manually trigger
setStatus((prev) => { switch (status) { // should we use switch(prev) as it may be possible that react will combine multi setStatus together
case 'align':
return 'motion';
case 'motion':
return 'stable';
default:
}
return prev;
});
callback?.();
});
}
The text was updated successfully, but these errors were encountered:
Checking goNextStatus() in useVisibleStatus.ts,
the source code look like this, for the switch condition, should we use prev instead of status?
function goNextStatus(callback?: () => void) {
cancelRaf();
rafRef.current = raf(() => {
// Only align should be manually trigger
setStatus((prev) => {
switch (status) { // should we use switch(prev) as it may be possible that react will combine multi setStatus together
case 'align':
return 'motion';
case 'motion':
return 'stable';
default:
}
}
The text was updated successfully, but these errors were encountered: