@secretstache/wordpress-gutenberg 0.4.6 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
import { useEffect, useRef } from '@wordpress/element';
|
2
2
|
|
3
|
-
export const useAccordionItem = (
|
3
|
+
export const useAccordionItem = ({
|
4
|
+
itemId,
|
5
|
+
activeItemId,
|
6
|
+
setActiveItemId,
|
7
|
+
contentSelector,
|
8
|
+
heightObserverDeps = []
|
9
|
+
}) => {
|
4
10
|
const isActive = itemId === activeItemId;
|
5
11
|
const blockRef = useRef(null);
|
6
12
|
|
@@ -44,7 +50,7 @@ export const useAccordionItem = (itemId, activeItemId, setActiveItemId, contentS
|
|
44
50
|
resizeObserver.observe(blockRef.current);
|
45
51
|
|
46
52
|
return () => resizeObserver.disconnect();
|
47
|
-
}, [ isActive ]);
|
53
|
+
}, [ isActive, ...heightObserverDeps ]);
|
48
54
|
|
49
55
|
return {
|
50
56
|
blockRef,
|