fix(shared, nextjs): Support importing @clerk/shared in @clerk/nextjs - #1767
Conversation
🦋 Changeset detectedLatest commit: 921892f The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
panteliselef
left a comment
There was a problem hiding this comment.
Do wee need to test this with snapshots ? Or should we be good as long this builds ? I remember someone mentioned a runtime error that is why i am asking.
|
Sorry didn't mean to approve, just to add a comment. |
|
@panteliselef do know mean this runtime error ?: #1760 (comment) |
yes, that one |
8c7279f to
a7c2274
Compare
b9df973 to
39a24a0
Compare
This change will resolve the following issue we had when importing
@clerk/shared in @clerk/nextjs:
```
Your're importing a component that needs useState. It only works in
a Client Component none of its parents are marked with "use client",
so they're Server Components by default.
[javascript/packages/shared/src/hooks/usePagesOrInfinite.js:1:1]
import { useCallback, useMemo, useRef, useState } from "react";
```
39a24a0 to
5864bc7
Compare
…variable deprecation
|
This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Review it per commit
Use
use clientdirective in @clerk/shared to support importing it in libraries compatible with RSC and use package in @clerk/nextjs (also replaced current copy/pasted code).Checklist
npm testruns as expected.npm run buildruns as expected.Type of change
Packages affected
@clerk/clerk-js@clerk/clerk-react@clerk/nextjs@clerk/remix@clerk/types@clerk/themes@clerk/localizations@clerk/clerk-expo@clerk/backend@clerk/clerk-sdk-node@clerk/shared@clerk/fastify@clerk/chrome-extensiongatsby-plugin-clerkbuild/tooling/chore