From 72b02990e6be9936d743b3e442a309d5b448cdc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Wed, 23 Nov 2022 18:07:01 +0100 Subject: [PATCH] Update React render --- site/source/entry-en.tsx | 7 +++++-- site/source/entry-fr.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/site/source/entry-en.tsx b/site/source/entry-en.tsx index 8ce3dd7f4..4e68b587f 100644 --- a/site/source/entry-en.tsx +++ b/site/source/entry-en.tsx @@ -1,6 +1,6 @@ import { I18nProvider } from '@react-aria/i18n' import { withProfiler } from '@sentry/react' -import { render } from 'react-dom' +import { createRoot } from 'react-dom/client' import App from './App' import i18next from './locales/i18n' @@ -30,5 +30,8 @@ if (!import.meta.env.SSR) { // eslint-disable-next-line no-console console.error(err) ) - render(, document.querySelector('#js')) + + const container = document.querySelector('#js') as Element + const root = createRoot(container) + root.render() } diff --git a/site/source/entry-fr.tsx b/site/source/entry-fr.tsx index c63c00a9c..353aecaa1 100644 --- a/site/source/entry-fr.tsx +++ b/site/source/entry-fr.tsx @@ -1,6 +1,6 @@ import { I18nProvider } from '@react-aria/i18n' import { withProfiler } from '@sentry/react' -import { render } from 'react-dom' +import { createRoot } from 'react-dom/client' import App from './App' import i18next from './locales/i18n' @@ -20,5 +20,7 @@ if (!import.meta.env.SSR) { // eslint-disable-next-line no-console console.error(err) ) - render(, document.querySelector('#js')) + const container = document.querySelector('#js') as Element + const root = createRoot(container) + root.render() }