Loading…
Topic
DOM
1 post about DOM. Every summary links to the original.
- 1 post
- 1 company
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Posts
Fixing the Google Translate crash in React without turning translation off
React applications crash with NotFoundError when Google Translate replaces text nodes with elements, because React still holds references to the detached nodes. The standard workaround of patching removeChild and insertBefore to skip detached nodes stops the crash but leaves stale translated text visible and new elements invisible. A mutation observer detects translation by monitoring for class=“translated-ltr” on , which appears about 190 ms before text swapping begins. The fix uses a WeakMap to pair each detached text node with its replacement , so removing the text removes its font and inserting before the text inserts before its font. The patches are only installed after translation is detected, leaving native DOM methods on untranslated pages so real bugs still reach error tracking.
Weekly digest
The best engineering reads, once a week.