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
to render rich text fields in a next.js server component and I decided to upgrade. I don't need slices, I just want to get my data into a single component and pass it down through props. Previously I was able to render them just fine using RichText.
Now the app barks at me for trying to use a context in a server component 😖 with
TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component
Is it possible to use this component without a context in a server component or do I have to revert to the old versions of this library?
The text was updated successfully, but these errors were encountered:
Hi @justin-hackin, React Server Components and Next.js' App Router is a significant change from pre-Next.js 13.4. The update required changes in how <PrismicRichText> works and, in some cases, how it is used.
I just published v2.6.0 which now supports Server Components. See #178 for more details.
You should be able to use <PrismicRichText> in Server Components now. 🙂
Previously, I was using
to render rich text fields in a next.js server component and I decided to upgrade. I don't need slices, I just want to get my data into a single component and pass it down through props. Previously I was able to render them just fine using
RichText
.I migrated to
Now the app barks at me for trying to use a context in a server component 😖 with
Is it possible to use this component without a context in a server component or do I have to revert to the old versions of this library?
The text was updated successfully, but these errors were encountered: