diff --git a/examples/basic-typescript/index.tsx b/examples/basic-typescript/index.tsx index 38db7489b..a3a972ffe 100644 --- a/examples/basic-typescript/index.tsx +++ b/examples/basic-typescript/index.tsx @@ -2,6 +2,7 @@ import 'react-app-polyfill/ie11'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { Formik, Field, Form, FormikHelpers } from 'formik'; +import { createRoot } from 'react-dom/client'; interface Values { firstName: string; @@ -51,4 +52,8 @@ const App = () => { ); }; -ReactDOM.render(, document.getElementById('root')); +const rootElement = document.getElementById('root'); +if (rootElement) { + const root = createRoot(rootElement); + root.render(); +}