useMutationObserver
Watch a DOM node for added or removed children, attribute changes and text edits. Use it to react to DOM that other code controls, such as third-party widgets or contenteditable regions.
- Level
- Intermediate
- Since
- v2.1.0
import {useMutationObserver} from '@zenuilabs/react-hooks';Loading demo_
More in Events & DOM
Events & DOMBasicuseClickOutsideCall a function when the user presses anywhere outside an element. Use it to close menus, popovers and dialogs.Events & DOMIntermediateuseEventAttach an event listener to the window, the document, an element or a ref, and remove it on unmount. The listener can change on every render without re-subscribing.Events & DOMBasicuseHoverTrack whether the pointer is over an element. Use it for previews, tooltips and hover styles that need JavaScript.