codex-team/editor.js

TS2351: This expression is not constructable.

Open

#2,624 创建于 2024年2月18日

在 GitHub 查看
 (2 评论) (4 反应) (0 负责人)TypeScript (26,602 star) (1,985 fork)batch import
good first issue

描述

Steps to reproduce:

  1. Change moduleResolution to node16 or nodenext in tsconfig.json

Expected behavior:

Type is correct

Screenshots:

'use client'
import EditorJS from '@editorjs/editorjs'
import { useCallback, useRef } from 'react'

export const Editor = () => {
  const editorRef = useRef<EditorJS.default | null>(null)
  return <div ref={useCallback((ref: HTMLDivElement | null) => {
    if (ref) {
      editorRef.current = new EditorJS({
        holder: ref
      })
    } else {
      editorRef.current?.destroy()
    }
  }, [])}
  />
}

Device, Browser, OS:

Editor.js version: latest

Plugins you use with their versions:

贡献者指南