Answer the question
In order to leave comments, you need to log in
Why does babel swear at this class syntax?
Why babel swears at a line test = null;
In the browser, such an entry works and does not give errors, but babel does not approve.
Recording static test = null;
is also not acceptable.
class Test {
test = null;
showTest() {
console.log(this.test);
}
}
Answer the question
In order to leave comments, you need to log in
Try adding to babel.config.js
module.exports = {
plugins: [
'@babel/plugin-proposal-class-properties'
]
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question