Getting StartedReact
Server Side Rendering (Next.js) - Using Cookies
A good alternative to the usage of QuirksNextProvider
is to use cookies to store session data, which can also be useful for the server.
Additionally, this method allows for the use of React Server Components with quirks.
Notice
This functionality requires @quirks/store version 0.25.0 or higher
Note
I use this approach for the homepage of this site!
Installation
Install the package
Usage with App Router
Create a providers.tsx
file:
Import it inside your layout.tsx
:
You did it 🎉! Now you can start using it as described inside quick start.
Usage with Pages Router
Add the providers inside your _app.tsx
:
You did it 🎉! Now you can start using it as described inside quick start.