awehook / blink-mind

Fully customizable mindmap framework for react.js. 支持插件的,可被完全定制的思维导图库,基于react.js和immutable.js。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`@blueprintjs/core`'s ES5 "class" breaks `@blink-mind/renderer-react`'s ES6 real class

hyrious opened this issue · comments

You used @HotkeysTarget in @blink-mind/renderer-react, then exported it as an ES6 library. But the @blueprintjs/core is in ES5. Therefore, in ES6 context, this code:

_super.apply(this, arguments) // in @blueprintjs/core

will raise an error

Class constructor MindDragScrollWidget cannot be invoked without 'new'

This is definitely a bug of @blueprintjs/core, which should export valid es6 class. But when I searched their issues, I found palantir/blueprint#2972 unresolved 3 years ago. So I came here for help, maybe you can use useHotkeys as suggested in their source code, or try another hotkey bindings library.

I guess you didn't find this issue mainly because of using webpack, which transforms all code to ES5 under the hood.