codex-team/editor.js

TS2351: This expression is not constructable.

Open

#2,624 opened on Feb 18, 2024

View on GitHub
 (2 comments) (4 reactions) (0 assignees)TypeScript (1,985 forks)batch import
good first issue

Repository metrics

Stars
 (26,602 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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:

Contributor guide