From 63234808da8d28449c7960e1dd236ec9a6cc9aeb Mon Sep 17 00:00:00 2001 From: Vaskevich Aleksander Date: Wed, 13 Apr 2022 17:25:28 +0300 Subject: [PATCH] fix the code block for createRoot typescript error (#4576) * fix the code block for createRoot typescript error * added example block code for typescript * Inline example Co-authored-by: dan --- content/blog/2022-03-08-react-18-upgrade-guide.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/blog/2022-03-08-react-18-upgrade-guide.md b/content/blog/2022-03-08-react-18-upgrade-guide.md index 677682a3..e1195189 100644 --- a/content/blog/2022-03-08-react-18-upgrade-guide.md +++ b/content/blog/2022-03-08-react-18-upgrade-guide.md @@ -40,9 +40,8 @@ render(, container); // After import { createRoot } from 'react-dom/client'; const container = document.getElementById('app'); -const root = createRoot(container); +const root = createRoot(container); // createRoot(container!) if you use TypeScript root.render(); - ``` We’ve also changed `unmountComponentAtNode` to `root.unmount`: