All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.components.frame.frame-content.js Maven / Gradle / Ivy

Go to download

A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.

The newest version!
'use client';
import { useRef, useEffect } from 'react';

const FrameContent = (props) => {
  const { onMount, onUnmount, children } = props;
  const mountedRef = useRef(false);
  const calledRef = useRef(false);
  useEffect(() => {
    if (!mountedRef.current && !calledRef.current) {
      onMount?.();
      mountedRef.current = true;
      calledRef.current = true;
    }
    return () => {
      if (mountedRef.current) {
        onUnmount?.();
        mountedRef.current = false;
      }
    };
  }, []);
  return children;
};

export { FrameContent };




© 2015 - 2025 Weber Informatics LLC | Privacy Policy