You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have an error when I click to view a file created with Editor.js, the problem occurs only when there is a table in it, on the default it works fine.
Unhandled Runtime Error
Error: Objects are not valid as a React child (found: [object Error]). If you meant to render a collection of children, use an array instead.
The error when converting to HTML from string, on this page:
import { OutputData } from "@editorjs/editorjs";
import React from "react";
import editorJsHtml from "editorjs-html";
const EditorJsToHtml = editorJsHtml();
type Props = {
data: OutputData;
};
type ParsedContent = string | JSX.Element;
const EditorJsRenderer = ({ data }: Props) => {
const html = EditorJsToHtml.parse(data) as ParsedContent[];
return (
<div className="prose ContractTemplate max-w-full" key={data.time}>
{html.map((item, index) => {
if (typeof item === "string") {
return (
<div dangerouslySetInnerHTML={{ __html: item }} key={index}></div>
);
}
return item;
})}
</div>
);
};
export default EditorJsRenderer;
I think it's because you return: string[][]. To be honest I don't know how to fix this.
A little help?
The text was updated successfully, but these errors were encountered:
Hi,
I have an error when I click to view a file created with Editor.js, the problem occurs only when there is a table in it, on the default it works fine.
The error when converting to HTML from string, on this page:
I think it's because you return: string[][]. To be honest I don't know how to fix this.
A little help?
The text was updated successfully, but these errors were encountered: