P
Prisma2y ago
Zaid

Safe to import Prisma in Client Component?

I was wondering if it's safe to import Prisma (namespace) from @prisma/client in a client component with the "use client" directive. Using NextJS btw.
5 Replies
Nurul
Nurul2y ago
What do you want to import in the frontend? Just the generated types from "@prisma/client"?
Zaid
ZaidOP2y ago
Yes
Nurul
Nurul2y ago
Importing types should be safe. I have seen users creating a separate folder just for types and importing from this folder in the frontend.
Zaid
ZaidOP2y ago
Sounds good, thank you!
Nurul
Nurul2y ago
No worries

Did you find this page helpful?