From 7cf7ec5f60711181779770afe4ddf24205b5d50c Mon Sep 17 00:00:00 2001 From: Robot Date: Thu, 24 Aug 2023 11:54:45 +0800 Subject: [PATCH] fix: It should use startTransition only when IS_REACT_LEGACY is false --- mutation/src/state.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mutation/src/state.ts b/mutation/src/state.ts index 410d37ad1..27b736001 100644 --- a/mutation/src/state.ts +++ b/mutation/src/state.ts @@ -4,10 +4,10 @@ import { useIsomorphicLayoutEffect, IS_REACT_LEGACY } from 'swr/_internal' export const startTransition: (scope: TransitionFunction) => void = IS_REACT_LEGACY - ? React.startTransition - : cb => { + ? cb => { cb() } + : React.startTransition /** * An implementation of state with dependency-tracking.