diff --git a/integration-with-routing-libraries.md b/integration-with-routing-libraries.md index 5626e75d1..6e8f5bb0b 100644 --- a/integration-with-routing-libraries.md +++ b/integration-with-routing-libraries.md @@ -68,71 +68,17 @@ Example [here](https://github.com/codegouvfr/react-dsfr/blob/ae8b3319a15064160b9 {% tab title="trype-route" %} type-route is an exeption amongs routing library in the sence that it dosen't require to use a Link component. As a result you only need to implement module augmentation +{% code title="index.tsx" %} ```tsx -import { StrictMode } from "react"; -import { createRoot } from "react-dom/client"; -import { startDsfrReact } from "@codegouvfr/react-dsfr"; -import { Home } from "./Home"; -import { Mui } from "./Mui"; -import { useRoute, RouteProvider } from "./router"; -import { Header } from "@codegouvfr/react-dsfr/Header"; -import { fr } from "@codegouvfr/react-dsfr"; import type { Link as TypeRouteLink } from "type-route"; -import { routes } from "./router"; - declare module "@codegouvfr/react-dsfr" { // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface LinkProps extends TypeRouteLink { } - -} - -startDsfrReact({ - "defaultColorScheme": "system" -}); - -createRoot(document.getElementById("root")!).render( - - -
-
- -
- - -); - -function Router() { - - const route = useRoute(); - - switch (route.name) { - case "mui": return ; - case "home": return ; - case false: return

404

- } - } ``` +{% endcode %} + +Example [here](https://github.com/codegouvfr/react-dsfr/blob/e8b78dd5ad069a322fbcc34b34b25d4ac8214e34/test/integration/cra/src/index.tsx#L33). {% endtab %} {% tab title="other" %} diff --git a/internationalisation.md b/internationalisation.md index 503806971..120df3a05 100644 --- a/internationalisation.md +++ b/internationalisation.md @@ -35,7 +35,7 @@ Example setup [in Next.js](https://github.com/etalab/etalab-website/blob/b427049 {% hint style="warning" %} DISLAMER: I'm the author of i18nifty. -While I can confidently recommend it for SPAs I have to warn you that using i18nifty in Next.js will force you to opt out from[ Automatic Static Optimization](https://nextjs.org/docs/messages/opt-out-auto-static-optimization) and bundle all your translations in the JavaScript bundle. SSR, SSO will work fine though. +While I confidently recommend it for SPAs I have to warn you that using i18nifty in Next.js will force you to opt out from[ Automatic Static Optimization](https://nextjs.org/docs/messages/opt-out-auto-static-optimization) and bundle all your translations in the JavaScript bundle. SSR, SSO will work fine though. {% endhint %} {% endtab %}