question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discussion: Provide jotai/nextjs utils

See original GitHub issue

We already provide some examples about how to use Jotai with Next.js and SSR in general.

This issue looks to start a discussion if it’s possible for Jotai for provide a better story for using Jotai in a SSR scenario - We believe we could start with Next.js.

I believe this would be mostly useful in the scenario, where you have async atoms, which fetch their state using e.g. fetch.

This is mostly inspired Next.js story for react-query: https://react-query.tanstack.com/guides/ssr

Let me think what you think - Should we provide something, or should we just document how to with our current API for “hydration” of atoms.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
Thisencommented, Aug 10, 2021

Hi everyone, there’s a new hook useHydrateAtoms - Please try it out in your Next.js app!

5reactions
dai-shicommented, Mar 7, 2021

jotai/nextjs would be very specific to nextjs depending on functions from nextjs. If there were any generic SSR utils, we should put them in jotai/utils.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found