Skip to content

Commit 0470919

Browse files
committed
fix(core): use react-fast-compare deep equal
1 parent 13c441d commit 0470919

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/sanity/src/core/form/useDocumentForm.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
useRef,
2020
useState,
2121
} from 'react'
22+
import deepEquals from 'react-fast-compare'
2223

2324
import {isSanityCreateLinkedDocument} from '../create/createUtils'
2425
import {type ConnectionState, useConnectionState} from '../hooks/useConnectionState'
@@ -36,7 +37,6 @@ import {
3637
usePresenceStore,
3738
} from '../store'
3839
import {EMPTY_ARRAY, getDraftId, getPublishedId, getVersionFromId, useUnique} from '../util'
39-
import {deepEquals} from '../validation/util/deepEquals'
4040
import {
4141
type FormState,
4242
getExpandOperations,
@@ -422,7 +422,6 @@ export function useDocumentForm(options: DocumentFormOptions): DocumentFormValue
422422
// to avoid the blur event to be triggered, we set a flag to disable it for a short period of time.
423423
disableBlurRef.current = true
424424

425-
// Reset focus path when url params path changes
426425
if (!deepEquals(focusPathRef.current, nextPath)) {
427426
setFocusPath(nextPath)
428427
handleSetOpenPath(nextPath)

0 commit comments

Comments
 (0)