This is the error I am getting.
Type 'OutputData' is not assignable to type 'IParser'.
Types of property 'time' are incompatible.
Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
My code :
import { OutputData } from "@editorjs/editorjs";
import { MetaFunction } from "@remix-run/react";
import { useState } from "react";
import { ClientOnly } from "remix-utils/client-only";
import Editor_Component from "~/components/editor_js/editor.client";
import { Parser, Table } from '@alkhipce/editorjs-react';
export const meta: MetaFunction = () => {
return [
{ title: "blog page" },
{ name: "description", content: "Welcome to Remix!" },
];
};
export default function Blog_View() {
const [data, setData] = useState<OutputData>();
return (
<div className="grid grid-cols-2">
<ClientOnly>
{() => (
<Editor_Component
holder="editorjs"
onChange={setData}
data={data}
></Editor_Component>
)}
</ClientOnly>
{data && <Parser data={data}></Parser>} // 👈 this is where error occurs
</div>
);
}
This is the error I am getting.
Type 'OutputData' is not assignable to type 'IParser'.
Types of property 'time' are incompatible.
Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
My code :