๐งInitial setup
Setup @codegouvfr/react-dsfr in your project or start from a template
And add this file to the root of your project, to enable pre & post scripts with pnpm:
If you want to use Yarn Berry you be aware that pre- post- scripts aren't supported.
So you must do something like "dev": "copy-dsfr-to-public && next dev" (same thing for start)
Also you must configure it so it uses node_modules (sorry)
If you want a more complete starter with a Ready yo use stack that includes routing, autentication, internationalisation ect. you can also use this starter instead:
Add these three scripts to your package.json:
Trigger the execution of the postinstall script by running:
Add the following tags in the <head />
You're all set! Next step for you is to setup the integration with your routing library (react-router for example).
๐Integration with routing libsAdd these three scripts to your package.json:
Trigger the execution of the postinstall script by running:
Add the following code in the <head />
You're all set! Next step for you is to setup de integration with your routing library (react-router for example)
๐Integration with routing libsYour framework isn't supported? Let's get in touch! Note: We don't have a custom integration for it but react-dsfr has been reported working with Gatsby.
Avoiding or flash of unstyled text (FOUT)
You can avoid having a flash of unstyled text by preloading the font variant used on your homepage (look in the network tab of your browser dev tools what are the font downloaded initially).
Add the following tags in the <head />
Add the following code in the <head />
Last updated
Was this helpful?
