Skip to content

Error: Type 'OutputData' is not assignable to type 'IParser'. #21

@fzsf163

Description

@fzsf163

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>
  );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions