Skip to content

Commit 55353e0

Browse files
committed
Revert "Fully switch ReactDOM to v18 mode"
This reverts commit 6c9efea. This seems to work fine in production but causes various issues in local dev, particularly with hot reloading. Better to disable that for now and live with the warning.
1 parent a5acf01 commit 55353e0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ initSentry(process.env.SENTRY_DSN);
1212

1313
import * as _ from 'lodash';
1414
import * as React from 'react';
15-
import * as ReactDOM from 'react-dom/client';
15+
import * as ReactDOM from 'react-dom';
1616
import * as mobx from 'mobx';
1717
import { Provider } from 'mobx-react';
1818

@@ -108,8 +108,7 @@ appStartupPromise.then(() => {
108108
console.log('App started, rendering');
109109

110110
document.dispatchEvent(new Event('load:rendering'));
111-
const root = ReactDOM.createRoot(document.querySelector(APP_ELEMENT_SELECTOR)!);
112-
root.render(
111+
ReactDOM.render(
113112
<Provider {...stores}>
114113
<StyleProvider>
115114
<ErrorBoundary>
@@ -118,7 +117,7 @@ appStartupPromise.then(() => {
118117
</ErrorBoundary>
119118
</StyleProvider>
120119
</Provider>
121-
);
120+
, document.querySelector(APP_ELEMENT_SELECTOR))
122121
});
123122

124123
const STARTUP_TIMEOUT = 10000;

src/util/ui.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ export function useSize(ref: React.RefObject<HTMLElement>, defaultValue: number)
165165

166166
if (container) {
167167
setSpaceAvailable(container.clientWidth);
168+
} else {
169+
logError("Element resized, but no ref available");
168170
}
169171
});
170172

@@ -175,7 +177,7 @@ export function useSize(ref: React.RefObject<HTMLElement>, defaultValue: number)
175177
}
176178

177179
return () => resizeObserver.disconnect();
178-
}, [ref]);
180+
}, []);
179181

180182
return spaceAvailable;
181183
}

0 commit comments

Comments
 (0)