From 6e4a87b5281a76b780a64dfaf1310ec06c9d6c37 Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Sat, 22 Oct 2022 16:59:33 -0700 Subject: [PATCH] react 18 createRoot --- src/client/webapp/preload.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/webapp/preload.tsx b/src/client/webapp/preload.tsx index fc880a8..99ba7b3 100644 --- a/src/client/webapp/preload.tsx +++ b/src/client/webapp/preload.tsx @@ -15,7 +15,7 @@ import Globals from './globals'; import PersonalDB from './personal-db'; import MessageRAMCache from './message-ram-cache'; import ResourceRAMCache from './resource-ram-cache'; -import ReactDOM from 'react-dom'; +import { createRoot } from 'react-dom/client'; import React from 'react'; import RootElement from './elements/root'; import { RecoilRoot } from 'recoil'; @@ -59,11 +59,11 @@ window.addEventListener('DOMContentLoaded', () => { LOG.silly('guildsManager initialized'); - ReactDOM.render( + const root = createRoot(document.getElementById('react-root')!); + root.render( , - document.getElementById('react-root'), - ); + ); })(); });