codex-team/editor.js

TS2351: This expression is not constructable.

Open

#2 624 ouverte le 18 févr. 2024

Voir sur GitHub
 (2 commentaires) (4 réactions) (0 assignés)TypeScript (1 985 forks)batch import
good first issue

Métriques du dépôt

Stars
 (26 602 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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:

Guide contributeur