diff --git a/examples/react/array/src/index.tsx b/examples/react/array/src/index.tsx index 482eba9e94..96643d8108 100644 --- a/examples/react/array/src/index.tsx +++ b/examples/react/array/src/index.tsx @@ -3,7 +3,7 @@ import { useForm } from '@tanstack/react-form' import { formDevtoolsPlugin } from '@tanstack/react-form-devtools' import ReactDOM from 'react-dom/client' import './index.css' -import { useMemo, useRef, useState } from 'react' +import { StrictMode, useMemo, useRef, useState } from 'react' function ArrayForm({ items }: { items: Array }) { const form = useForm({ @@ -120,4 +120,8 @@ function App() { ) } -ReactDOM.createRoot(document.getElementById('root')!).render() +ReactDOM.createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/examples/react/basic-splitting-form/src/index.tsx b/examples/react/basic-splitting-form/src/index.tsx index 5e557c3ea3..5c89bbb9bf 100644 --- a/examples/react/basic-splitting-form/src/index.tsx +++ b/examples/react/basic-splitting-form/src/index.tsx @@ -1,3 +1,4 @@ +import * as React from 'react' import { TanStackDevtools } from '@tanstack/react-devtools' import { useForm } from '@tanstack/react-form' import { formDevtoolsPlugin } from '@tanstack/react-form-devtools' @@ -58,4 +59,8 @@ function App() { ) } -ReactDOM.createRoot(document.getElementById('root')!).render() +ReactDOM.createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/examples/react/basic/src/index.tsx b/examples/react/basic/src/index.tsx index a045cb10d8..c8136aceab 100644 --- a/examples/react/basic/src/index.tsx +++ b/examples/react/basic/src/index.tsx @@ -1,3 +1,4 @@ +import * as React from 'react' import { TanStackDevtools } from '@tanstack/react-devtools' import { useForm } from '@tanstack/react-form' import { formDevtoolsPlugin } from '@tanstack/react-form-devtools' @@ -139,4 +140,8 @@ function App() { ) } -ReactDOM.createRoot(document.getElementById('root')!).render() +ReactDOM.createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/examples/react/expo/index.ts b/examples/react/expo/index.ts index 81a299a637..b3720bff61 100644 --- a/examples/react/expo/index.ts +++ b/examples/react/expo/index.ts @@ -1,5 +1,10 @@ +import { StrictMode, createElement } from 'react' import { registerRootComponent } from 'expo' import App from './app/index' -registerRootComponent(App) +function Root() { + return createElement(StrictMode, null, createElement(App)) +} + +registerRootComponent(Root) diff --git a/examples/react/field-groups/src/index.tsx b/examples/react/field-groups/src/index.tsx index 2ae25b15ed..27763b01d0 100644 --- a/examples/react/field-groups/src/index.tsx +++ b/examples/react/field-groups/src/index.tsx @@ -1,3 +1,4 @@ +import * as React from 'react' import { TanStackDevtools } from '@tanstack/react-devtools' import { useForm } from '@tanstack/react-form' import { formDevtoolsPlugin } from '@tanstack/react-form-devtools' @@ -143,4 +144,8 @@ function App() { ) } -ReactDOM.createRoot(document.getElementById('root')!).render() +ReactDOM.createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/examples/react/nextjs/next.config.ts b/examples/react/nextjs/next.config.ts index 1830ed6a93..095b6a669e 100644 --- a/examples/react/nextjs/next.config.ts +++ b/examples/react/nextjs/next.config.ts @@ -1,5 +1,7 @@ import type { NextConfig } from 'next' -const nextConfig: NextConfig = {/* config options here */} +const nextConfig: NextConfig = { + reactStrictMode: true, +} export default nextConfig diff --git a/examples/react/ui-integration-dnd-kit/src/index.tsx b/examples/react/ui-integration-dnd-kit/src/index.tsx index f7be5b0400..614d05c7db 100644 --- a/examples/react/ui-integration-dnd-kit/src/index.tsx +++ b/examples/react/ui-integration-dnd-kit/src/index.tsx @@ -1,3 +1,4 @@ +import * as React from 'react' import { TanStackDevtools } from '@tanstack/react-devtools' import { formDevtoolsPlugin } from '@tanstack/react-form-devtools' import { createRoot } from 'react-dom/client' @@ -25,4 +26,8 @@ function App() { ) } -createRoot(document.getElementById('root')!).render() +createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/examples/react/ui-integration-shadcn/src/index.tsx b/examples/react/ui-integration-shadcn/src/index.tsx index 97c609d593..3727fb8abb 100644 --- a/examples/react/ui-integration-shadcn/src/index.tsx +++ b/examples/react/ui-integration-shadcn/src/index.tsx @@ -1,3 +1,4 @@ +import * as React from 'react' import ReactDOM from 'react-dom/client' import './index.css' import { TanStackDevtools } from '@tanstack/react-devtools' @@ -20,4 +21,8 @@ function App() { ) } -ReactDOM.createRoot(document.getElementById('root')!).render() +ReactDOM.createRoot(document.getElementById('root')!).render( + + + , +)