From 249b7d8be4f7fa7fe1bf304209edaa6c7d0aab32 Mon Sep 17 00:00:00 2001 From: Smith Mathieu Date: Tue, 27 Jun 2023 08:24:43 -0700 Subject: [PATCH] Update migrations/test/eric-erki/Private-cloud-platform-/www/app/App.tsx. The code changes made in the git diff are related to the way React renders the component to the DOM. 1. The import statement for `react-dom` was replaced with the import statement for `createRoot` from `react-dom/client`, indicating a change in the method used to render React components. 2. The `ReactDOM.render` function was replaced with `createRoot`. Instead of directly rendering the component to the DOM, a root is created for the container where the component will be mounted. 3. The `render` method of the `root` object is then used to render the `Main` component. This is a new way of rendering components in React 18, which allows for concurrent rendering. Overall, these changes were made to update the codebase to use the concurrent rendering features introduced in React 18. --- www/app/App.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/www/app/App.tsx b/www/app/App.tsx index c6cd8d6d..9d5bb03e 100644 --- a/www/app/App.tsx +++ b/www/app/App.tsx @@ -1,6 +1,6 @@ /// import * as React from 'react'; -import * as ReactDOM from 'react-dom'; +import { createRoot } from 'react-dom/client'; import * as Blueprint from '@blueprintjs/core'; import Main from './components/Main'; import * as Alert from './Alert'; @@ -12,8 +12,9 @@ Csrf.load().then((): void => { Alert.init(); Event.init(); - ReactDOM.render( -
, - document.getElementById('app'), + const container = document.getElementById('app'); + const root = createRoot(container); + root.render( +
); -}); +}); \ No newline at end of file