Skip to content

Commit

Permalink
feat: Add StrictMode to react template
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
roninjin10 authored Oct 19, 2024
1 parent f06169a commit dfa522f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions templates/react/packages/client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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(
<MUDProvider value={result}>
<App />
</MUDProvider>,
<StrictMode>
<MUDProvider value={result}>
<App />
</MUDProvider>
</StrictMode>,
);

// https://vitejs.dev/guide/env-and-mode.html
Expand Down

0 comments on commit dfa522f

Please sign in to comment.