You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having `import { cache } from 'react'` caused issues when using
React 18 or 19 GA, because the `cache` function is only exported
in canary builds (which the Next.js app router uses internally,
regardless of what's in your app's package.json).
This meant importing from `'nuqs/server'` caused an import error
when done from non app-router code, like the pages router, or
API route definitions, which would fallback to the version of React
defined in the package.json (and likely a stable one).
Changing the import to `import * as React from 'react'` is what is
being highlighted in the React docs themselves, and allows to only
call the cache function when actually creating a cache object.
Closes#804, and supersedes #805.
0 commit comments