Next.js Discord

Discord Forum

sharing code between 2 next.js projects

Unanswered
Shetland Sheepdog posted this in #help-forum
Open in Discord
Shetland SheepdogOP
Hello, it's not a bug, but a question 🙂

I have 2 next.js projects living in a monorepo managed by yarn workspaces and turborepo, say proj1 and proj2.

If I want to use a component A from proj1 in the other project proj2, can I simply import A from proj1 instead of adding another package, shared-ui for instance, and then move A to this ui package? I am seeking simplicity, and therefore trying to avoid adding the shared-ui package.

0 Replies