React Strict Mode (#38895)

This commit is contained in:
Echo 2026-05-07 12:03:08 +02:00 committed by GitHub
parent 60a437e045
commit c47922602f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class IntersectionObserverWrapper {
this.observerBacklog.forEach(([ id, node, callback ]) => {
this.observe(id, node, callback);
});
this.observerBacklog = null;
this.observerBacklog = [];
}
observe (id, node, callback) {

View File

@ -1,3 +1,4 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { Globals } from '@react-spring/web';
@ -33,7 +34,11 @@ function main() {
await initializeEmoji();
const root = createRoot(mountNode);
root.render(<Mastodon {...props} />);
root.render(
<StrictMode>
<Mastodon {...props} />
</StrictMode>,
);
store.dispatch(setupBrowserNotifications());
if (isProduction() && me && 'serviceWorker' in navigator) {