Skip to content

Commit

Permalink
fix: It should use startTransition only when IS_REACT_LEGACY is false
Browse files Browse the repository at this point in the history
  • Loading branch information
TopGrd authored and Bug Destroyer committed Aug 24, 2023
1 parent e510955 commit 7cf7ec5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mutation/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7cf7ec5

Please sign in to comment.