'Editor' cannot be used as a JSX component. #290
Unanswered
arthureberledev
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hey I'll just move this to discussions. The library was also update with breaking change so now the Editor component looks like this export type EditorContentProps = {
children: React.ReactNode;
className?: string;
initialContent?: JSONContent;
} & Omit<EditorProviderProps, "content">;
export const EditorContent = ({
className,
children,
initialContent,
...rest
}: EditorContentProps) => {
const extensions = useMemo(() => {
return [...simpleExtensions, ...(rest.extensions ?? [])];
}, [rest.extensions]);
return (
<div className={className}>
<EditorProvider {...rest} content={initialContent} extensions={extensions}>
{children}
</EditorProvider>
</div>
);
}; |
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
-
Hey,
so I've been trying to create an PR that extends the editor by allowing to pass a ref to it:
But ever since I've implemented this, i get an type error in my frontend when trying to import this new component:
I've already tried to update the
@types/react
dependency (btw. there are two of them), but this only leads to an type error in the library itself (with the same error message on the<EditorContent>
Component...)Can anyone help out with this error? Knows what could help?
Beta Was this translation helpful? Give feedback.
All reactions