From dfa522f596bb1d6aebdfe4f3b7692339cf0631f5 Mon Sep 17 00:00:00 2001 From: Will Cory Date: Fri, 18 Oct 2024 22:56:41 -0700 Subject: [PATCH] feat: Add StrictMode to react template Adding strict mode will create more robust applications including - Less of a chance of a hiddent time bomb of an infinite loop that jus thappenes to not be getting triggered yet - Less of a chance of having bugs related to non hermetic useEffects etc. --- templates/react/packages/client/src/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/react/packages/client/src/index.tsx b/templates/react/packages/client/src/index.tsx index c9b662c9f0..3b79087418 100644 --- a/templates/react/packages/client/src/index.tsx +++ b/templates/react/packages/client/src/index.tsx @@ -1,4 +1,5 @@ import ReactDOM from "react-dom/client"; +import {StrictMode} from 'react' import { App } from "./App"; import { setup } from "./mud/setup"; import { MUDProvider } from "./MUDContext"; @@ -11,9 +12,11 @@ const root = ReactDOM.createRoot(rootElement); // TODO: figure out if we actually want this to be async or if we should render something else in the meantime setup().then(async (result) => { root.render( - - - , + + + + + , ); // https://vitejs.dev/guide/env-and-mode.html