prismicio / slice-machine

A series of tools for developing and deploying website sections with Prismic
https://prismic.io/docs
Apache License 2.0
287 stars 53 forks source link

[adapter-next] Update link field snippet to use `<PrismicNextLink>` #967

Closed angeloashmore closed 1 year ago

angeloashmore commented 1 year ago

Is your feature request related to a problem? Please describe.

@slicemachine/adapter-next's link field snippet uses <PrismicLink>.

<PrismicLink> only works if the Next.js app is set up with the correct @prismicio/react configuration.

The latest @prismicio/next and Prismic documentation does not recommend <PrismicLink>. Instead, @prismicio/next's new <PrismicNextLink> should be used as it does not require any configuration.

Describe the solution you'd like

Replace the link field snippet with the following:

<PrismicNextLink field={path.to.field}>Link</PrismicNextLink>

Describe alternatives you've considered

N/A

Additional context

<PrismicNextLink> was recently introduced in @prismicio/next v1.1.0. Not all users will have updated to the latest version, but I think it's simpler for us to recommend latest features rather than include conditions to support all past versions.

comeprismic commented 1 year ago

Hi @angeloashmore, this update has been implemented. I'm happy to close this issue :)

Thanks again for submitting it!