Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when creating ES6 functions #86

Open
codestitch opened this issue Jul 5, 2017 · 1 comment
Open

Error when creating ES6 functions #86

codestitch opened this issue Jul 5, 2017 · 1 comment

Comments

@codestitch
Copy link

Hi. I am writing functions inside the component class in my react js project. when I write like this function:

saySomething = (something) => { console.log(something); }

an error occurs.

screen shot 2017-07-05 at 5 53 02 pm

What should I do?

Thank you.

@akhilpanchal
Copy link

akhilpanchal commented Dec 17, 2017

You can fix this by installing the babel-plugin-transform-class-properties package and adding it to your conf/webpack/Base.js
Ref: https://stackoverflow.com/questions/42063854/arrow-function-syntax-not-working-with-webpack?answertab=active#tab-top

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants