Active le mode strict de React

Permet de détecter certains problèmes potentiels
https://fr.reactjs.org/docs/strict-mode.html

Activé car on a certaines erreurs étranges remontées par Sentry
pull/1803/head
Maxime Quandalle 2021-10-26 17:21:13 +02:00
parent 5ac978e9ef
commit 86e8696d50
1 changed files with 18 additions and 16 deletions

View File

@ -10,7 +10,7 @@ import {
} from 'Components/utils/EngineContext'
import { SitePathsContext } from 'Components/utils/SitePathsContext'
import 'iframe-resizer'
import { useContext, useMemo } from 'react'
import { StrictMode, useContext, useMemo } from 'react'
import { Helmet } from 'react-helmet'
import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
@ -53,21 +53,23 @@ export default function Root({ basename, rules }: RootProps) {
const paths = constructLocalizedSitePath(language as 'fr' | 'en')
const engine = useMemo(() => engineFactory(rules), [rules])
return (
<Provider
basename={basename}
sitePaths={paths}
onStoreCreated={(store) => {
setupInFranceAppPersistence(store)
setupSimulationPersistence(store)
}}
initialStore={{
inFranceApp: retrievePersistedInFranceApp(),
}}
>
<EngineProvider value={engine}>
<Router />
</EngineProvider>
</Provider>
<StrictMode>
<Provider
basename={basename}
sitePaths={paths}
onStoreCreated={(store) => {
setupInFranceAppPersistence(store)
setupSimulationPersistence(store)
}}
initialStore={{
inFranceApp: retrievePersistedInFranceApp(),
}}
>
<EngineProvider value={engine}>
<Router />
</EngineProvider>
</Provider>
</StrictMode>
)
}