useMutationObserverRef
About
A hook that tracks mutations of an element. It returns a callbackRef.
Examples
Arguments
Argument | Type | Description | Default value |
---|---|---|---|
callback | function | Function which should be invoked on mutation. It is called with the mutationList and observer | undefined |
config | object | Mutation Observer configuration | {attributes: true,,characterData: true,,subtree: true,,childList: true} |
Return value
Returns an array with one element
Argument | Type | Description |
---|---|---|
ref | CallbackRef | Ref which should be observed for Mutations |