I´m working around the google translate react bug, I’ve deactivated the translation in the HTML so it doesnt crash but I want to let know the user that Google Translate is not available on this page.
I´m setting this observer: ` useEffect(() => {
const targetNode = document.documentElement;
const config = { childList: true, subtree: true };
const callback = mutationList => {
for (const mutation of mutationList) {
if (mutation.type === 'childList') {
toast.warning('Google Translate cannot be used in this page');
}
}
};
const observer = new MutationObserver(callback);
observer.observe(targetNode, config);
observer.disconnect();
});`
But its triggering with al the changes in the DOM, how can I only get the google translate change if its at all possible?