-
I have this custom block registered as import { BlocksFeature, lexicalEditor } from "@payloadcms/richtext-lexical";
export default buildConfig({
// Other stuff before this...
editor: lexicalEditor({
features: ({ defaultFeatures }) => [
...defaultFeatures,
BlocksFeature({
blocks: [
{
slug: "gallery",
fields: [
{
name: "image",
type: "upload",
relationTo: "media",
hasMany: true,
},
],
},
],
}),
],
}),
// More stuff after...
}) I try to assign it a converter: const jsxConverters: JSXConvertersFunction = ({ defaultConverters }) => ({
...defaultConverters,
blocks: {
gallery: (params) => {
return <div>Gallery</div>;
},
},
}); But I get this error:
Am I missing something? |
Beta Was this translation helpful? Give feedback.
Answered by
AlessioGr
Feb 16, 2025
Replies: 1 comment 2 replies
-
You need to provide the block type as a generic to |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
oncet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to provide the block type as a generic to
JSXConvertersFunction
. Check out the website template as an example:payload/templates/website/src/components/RichText/index.tsx
Line 38 in 779f511