From 661fc64924fcb72d0e1f0eaf5425c0fd6b6b858e Mon Sep 17 00:00:00 2001 From: Halit Aksoy Date: Sun, 17 Jul 2022 08:38:25 +0300 Subject: [PATCH] migrate to react18 (use createRoot) --- src/App.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 4879b0c..5edb8b9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; -import { render } from 'react-dom'; import { initContext } from './context/context'; - -import Home from './routes/Home'; - initContext(); -render(, document.getElementById('main')); \ No newline at end of file +import * as React from 'react'; +import { createRoot } from 'react-dom/client'; +const container = document.getElementById('main'); +const root = createRoot(container!); +import Home from './routes/Home'; +root.render(); \ No newline at end of file