This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function logMutation(mutation) { | |
| console.log(mutation); | |
| } | |
| const mutationObserver = new MutationObserver((mutations) => { | |
| for (const mutation of mutations) { | |
| // Build a reason object that will let the user know what exactly happened | |
| let details = null; | |
| if (mutation.type === "attributes") { | |
| details = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function mergeRefs(refs) { | |
| return (value) => { | |
| refs.forEach((ref) => { | |
| if (typeof ref === "function") { | |
| ref(value); | |
| } else if (ref != null) { | |
| ref.current = value; | |
| } | |
| }); | |
| }; |
OlderNewer