React Strict Mode (#38895)
This commit is contained in:
parent
60a437e045
commit
c47922602f
@ -25,7 +25,7 @@ class IntersectionObserverWrapper {
|
|||||||
this.observerBacklog.forEach(([ id, node, callback ]) => {
|
this.observerBacklog.forEach(([ id, node, callback ]) => {
|
||||||
this.observe(id, node, callback);
|
this.observe(id, node, callback);
|
||||||
});
|
});
|
||||||
this.observerBacklog = null;
|
this.observerBacklog = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
observe (id, node, callback) {
|
observe (id, node, callback) {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { StrictMode } from 'react';
|
||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
|
|
||||||
import { Globals } from '@react-spring/web';
|
import { Globals } from '@react-spring/web';
|
||||||
@ -33,7 +34,11 @@ function main() {
|
|||||||
await initializeEmoji();
|
await initializeEmoji();
|
||||||
|
|
||||||
const root = createRoot(mountNode);
|
const root = createRoot(mountNode);
|
||||||
root.render(<Mastodon {...props} />);
|
root.render(
|
||||||
|
<StrictMode>
|
||||||
|
<Mastodon {...props} />
|
||||||
|
</StrictMode>,
|
||||||
|
);
|
||||||
store.dispatch(setupBrowserNotifications());
|
store.dispatch(setupBrowserNotifications());
|
||||||
|
|
||||||
if (isProduction() && me && 'serviceWorker' in navigator) {
|
if (isProduction() && me && 'serviceWorker' in navigator) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user