useMutationObserver

Observe changes in the attributes, children or text of an element.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

Count the children added to the list.

APIs

useMutationObserver

const useMutationObserver = <T extends HTMLElement = HTMLElement>(
  callback: MutationCallback,
  options: MutationObserverInit,
) => RefObject<T | null>
Edit this page on GitHub