@norges-domstoler/dds-components 22.8.0 → 22.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -741,7 +741,6 @@ var useAccordion = ({
741
741
  }, [setIsExpanded]);
742
742
  const bodyContentRef = useRef5(null);
743
743
  const [animate, setAnimate] = useState6(false);
744
- const isMounted = useIsMounted();
745
744
  const height = useElementHeight(bodyContentRef.current);
746
745
  const [initialExpandedHeight, setIntialExpandedHeight] = useState6(null);
747
746
  useLayoutEffect2(() => {
@@ -750,10 +749,11 @@ var useAccordion = ({
750
749
  }
751
750
  }, []);
752
751
  useEffect11(() => {
753
- if (isMounted()) {
752
+ const raf = requestAnimationFrame(() => {
754
753
  setAnimate(true);
755
- }
756
- }, [isMounted]);
754
+ });
755
+ return () => cancelAnimationFrame(raf);
756
+ }, []);
757
757
  const headerProps = {
758
758
  id: `${accordionId}-header`,
759
759
  onClick: toggleExpanded,