codex-team/editor.js

TS2351: This expression is not constructable.

Open

#2.624 aberto em 18 de fev. de 2024

Ver no GitHub
 (2 comments) (4 reactions) (0 assignees)TypeScript (1.985 forks)batch import
good first issue

Métricas do repositório

Stars
 (26.602 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 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:

Guia do colaborador