-
I'm trying to create a new plugin with custom react component: import { createPluginFactory } from '@udecode/plate';
import { WidgetBlock } from './WidgetBlock';
export const ELEMENT_WIDGET = 'widget';
export const createWidgetPlugin = createPluginFactory({
key: ELEMENT_WIDGET,
type: ELEMENT_WIDGET,
isLeaf: true,
component: WidgetBlock,
}); And I'm testing if it works (but not logging anything): import React from 'react';
export interface IWidgetBlockProps {}
export function WidgetBlock(props: IWidgetBlockProps): JSX.Element {
// DEBUG: console
console.log(`props`, props);
return <div>WidgetBlock</div>;
} And for data, I return a node like this:
But nothing rendered...Only empty text node. |
Beta Was this translation helpful? Give feedback.
Answered by
zbeyens
Apr 26, 2022
Replies: 1 comment 3 replies
-
There is a mismatch between the node and the plugin: the node is not a leaf |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
linonetwo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a mismatch between the node and the plugin: the node is not a leaf