Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS2351: This expression is not constructable. #2624

Open
himself65 opened this issue Feb 18, 2024 · 1 comment
Open

TS2351: This expression is not constructable. #2624

himself65 opened this issue Feb 18, 2024 · 1 comment
Labels

Comments

@himself65
Copy link
Member

himself65 commented Feb 18, 2024

Steps to reproduce:

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

Expected behavior:

Type is correct

Screenshots:

image
'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:

@himself65 himself65 added the bug label Feb 18, 2024
@neSpecc
Copy link
Member

neSpecc commented Feb 21, 2024

@himself65 could you get it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants