Every time I’ve tried to use fat arrow functions like this, I get a syntax error. At least the first few times I looked at the error (briefly) it was about “experimental syntax” not being turned on — any idea what I’m missing?
Okay... but I’m using Babel with webpack to transpire my code. Is there a specific preset I need, looks like ‘stage-0’ perhaps? Or plugins like ‘transform-decorators-legacy’?
1
u/scweiss1 Dec 18 '18
When you say you’re using the arrow functions in react, are those inside the Class definition?
Every time I’ve tried to use fat arrow functions like this, I get a syntax error. At least the first few times I looked at the error (briefly) it was about “experimental syntax” not being turned on — any idea what I’m missing?