Skip to content

Commit

Permalink
fix(react): change useEffect to useIsomorphicLayoutEffect in ErrorBou…
Browse files Browse the repository at this point in the history
…ndaryGroup
  • Loading branch information
minsoo-web committed Oct 19, 2023
1 parent 4af2b4c commit 93977cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react/src/ErrorBoundaryGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ComponentProps, ComponentType, PropsWithChildren } from 'react'
import { createContext, useContext, useEffect, useMemo } from 'react'
import { useIsChanged, useKey } from './hooks'
import { createContext, useContext, useMemo } from 'react'
import { useIsChanged, useIsomorphicLayoutEffect, useKey } from './hooks'
import type { PropsWithoutChildren } from './types'
import { assert } from './utils'

Expand All @@ -27,7 +27,7 @@ export const ErrorBoundaryGroup = ({ blockOutside = false, children }: ErrorBoun
const parentGroup = useContext(ErrorBoundaryGroupContext)
const isParentGroupResetKeyChanged = useIsChanged(parentGroup?.resetKey)

useEffect(() => {
useIsomorphicLayoutEffect(() => {
if (!blockOutside && isParentGroupResetKeyChanged) {
reset()
}
Expand Down

0 comments on commit 93977cb

Please sign in to comment.