werkbank
    Preparing search index...
    • Watches for changes to the DOM tree using MutationObserver.

      Parameters

      • target: Node | null

        The DOM node to observe.

      • callback: MutationCallback

        The callback to execute when mutations occur.

      • config: MutationObserverInit = {}

        The mutation observer configuration options.

      Returns void

      This hook creates a MutationObserver and observes the target node. It automatically updates the observer when the configuration changes.

      useMutationObserver(
      ref.current,
      (mutations) => {
      console.log("DOM changed!", mutations);
      },
      { childList: true, subtree: true }
      );