We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9af5ca commit 06c9e9fCopy full SHA for 06c9e9f
src/useMutationObserver.ts
@@ -7,8 +7,15 @@ import { useRef } from 'react'
7
8
type Deps = [Element | null | undefined, MutationObserverInit]
9
10
-const isDepsEqual: IsEqual<Deps> = (prev, next) =>
11
- prev[0] === next[0] && isEqual(prev[1], next[1])
+function isDepsEqual(
+ [nextElement, nextConfig]: Deps,
12
+ [prevElement, prevConfig]: Deps,
13
+) {
14
+ return (
15
+ nextElement === prevElement &&
16
+ isEqual(nextConfig, prevConfig)
17
+ );
18
+}
19
20
/**
21
* Observe mutations on a DOM node or tree of DOM nodes.
0 commit comments