Unable to override importJSON in CustomParagraphNode #4131
Unanswered
TheSwilliam
asked this question in
Q&A
Replies: 1 comment 1 reply
-
This is the type declaration for
As you can see, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am getting a TS error on my CustomParagraphNode class that says:
Class static side 'typeof CustomParagraphNode' incorrectly extends base class static side 'typeof ParagraphNode'.
Types of property 'importJSON' are incompatible.
Type '(serializedNode: SerializedCustomParagraphNode) => CustomParagraphNode' is not assignable to type '(serializedNode: SerializedParagraphNode) => ParagraphNode'.
Types of parameters 'serializedNode' and 'serializedNode' are incompatible.
Type 'SerializedParagraphNode' is not assignable to type 'SerializedCustomParagraphNode'.
Property 'backgroundColor' is missing in type 'SerializedParagraphNode' but required in type '{ type: "custom_paragraph";
backgroundColor: string | undefined; }'.ts(2417)
CustomParagraphNode.tsx(18, 5): 'backgroundColor' is declared here.
Here is the code:
Any ideas on how to fix this would be greatly appreciated! Thanks
Beta Was this translation helpful? Give feedback.
All reactions