Babel is replacing this
with void 0
how can I prevent this behavior?
I have this code:
((parent)=>{
parent.something = {}
})(this)
With babel it renders like
(function (parent) {
parent.something = {}
})(void 0);
I need this
(function (parent) {
parent.something = {}
})(this);
I know that I can use self
but this is not the same in all cases
In the babelrc
file or your bundler config set babel with:
presets: [["@babel/preset-env", { modules: false }]]
Note the double brackets, reason here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With