Version: v4.9.2
use-mutation-observer-ref
#
AboutA hook that tracks mutations of an element. It returns a callbackRef.
#
Installation#
Importing the hook#
Usage#
ArgumentsArgument | 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 valueReturns an array with one element
Argument | Type | Description |
---|---|---|
ref | React ref | Ref which should be observed for Mutations |
#
Join Bhargav's discord serverYou can click on the floating discord icon at the bottom right of the screen and talk to us in our server.