Closed dcecile closed 4 years ago
Hey @dcecile ,
it makes a lot of sense. The elements
property is really new, I'm already happy you tried it out! Expect a fix in the coming days πIn the meantime, you can use the htmlSerializer
of course
Thanks, looking forward to it!
I was able to work around this initially using a CSS rule for img
, but we'd also like to use Next.js Link
components for hyperlinks within our site.
@hypervillain We'd also like to substitute button
elements for links to a special content type (deep linking into a chat flow).
I don't see the new code yet, so can you update this issue once the feature is released? We'd start using it right away instead of doing a workaround that would involve HTML building or element replacing.
Hey, thanks for your patience, I just merged a PR that should better handle different element types. Thank you for reporting this @dcecile
@hypervillain OK thanks, we'll take a look! π
Awesome! It's been deployed as a minor version bump
On Thu, Mar 12, 2020 at 1:50 PM Dan Cecile notifications@github.com wrote:
@hypervillain https://github.com/hypervillain OK thanks, we'll take a look! π
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/prismicio/prismic-reactjs/issues/48#issuecomment-598167377, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSDRAIIZ76PJCQXQFOZX4TRHDK75ANCNFSM4KQXZKDQ .
I tried to override
elements={{[Elements.image]: CustomImage}}
, but got a confusing error:This is because for any custom elements, the library only provides children, which is invalid in the case of
img
.Maybe in the places where
createElement('...', ...)
is used inrichtext.js
, try checkingelements
first?