prismicio / prismic-react

React components and hooks to fetch and present Prismic content
https://prismic.io/docs/technologies/homepage-reactjs
Apache License 2.0
153 stars 40 forks source link

TypeScript error when using `<SliceZone>` with Next.js's `next/dynamic` #155

Closed angeloashmore closed 1 year ago

angeloashmore commented 1 year ago

Details to be posted later

Issue reported by @kb1995

Versions

Reproduction

Additional Details

Steps to reproduce

What is expected?

What is actually happening?

angeloashmore commented 1 year ago

I was unable to reproduce on the latest version of @prismicio/react (v2.4.2) and next/dynamic.

v2.4.2 included a change to <SliceZone> that relaxed the type requirements which may have resolved the type incompatibility.

It's worth noting that Slice components provided to <SliceZone> must still be typed with SliceComponentProps as those are the only props that will be passed to the component.

See #154 for examples of using SliceComponentProps using different combinations of types.