Jotai Example

I used Jotai and Next.js to create this very simple example. It renders two client components from within a server component, and uses Jotai to give both client components access to a shared state, i.e. the background colour.

Client Component

Client Component

Server Component

View the source code here.

I used the docs and this tutorial by Jack Herrington.

Built by Ollie Cook🍪