Description
When importing chop-logic-components directly into Next.js server component (like pages in app router folder), we got a 'use-client' missing error:
To avoid that we can re-export chop-logic-components in next lib folder like so:
"use client";
export * from "chop-logic-components";
And the import components inside next app from the lib:
import { Button, Header, IconName } from "@/lib/chop-logic-components";
We need to investigate how to make the direct import to server side components possible without re-exporting. If it's possible, we need to modify the library to support server side apps directly.
Additional Context
StackOverflow thread
Code of Conduct
Description
When importing chop-logic-components directly into Next.js server component (like pages in app router folder), we got a 'use-client' missing error:
To avoid that we can re-export chop-logic-components in next
libfolder like so:And the import components inside next app from the lib:
We need to investigate how to make the direct import to server side components possible without re-exporting. If it's possible, we need to modify the library to support server side apps directly.
Additional Context
StackOverflow thread
Code of Conduct