npm + babel - Uncaught TypeError: xxx is not a function
929 ワード
クラス内でメソッドをコールするとタイトルのようなエラーが出た。
Uncaught TypeError: xxx is not a function
this
が参照できなかったらしいのでコンストラクタ内でbindしておくとうまくいった。
class MyClass {
constructor() {
this.myMethod = this.myMethod.bind(this);
}
...
Author And Source
この問題について(npm + babel - Uncaught TypeError: xxx is not a function), 我々は、より多くの情報をここで見つけました https://qiita.com/narupo/items/0ab3100038cec187f588著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .