Custom serialisers only have 4 arguments -
function htmlSerialiser (type, element, content, children) {
if (type === 'hyperlink') {
return (
<a href={PrismicDOM.Link.url(element.data, linkResolver)}>
{content}
</a>
)
} else {
return null
}
}
That error sounds like you aren’t passing in the right value into the link, however. Can you console.log
the page data, and what you are passing in to the <RichText />
component?