Create-react-app: Add `babel-plugin-transform-class-properties` to babel

Created on 24 Aug 2018  路  1Comment  路  Source: facebook/create-react-app

If I try to use this tool together with react-native-web several libraries don't work, because in react-native it's common to use syntax like this:

class Test extends Component {
  handleBackPress = () => {
    this.goBack();
    return true;
  }
}

So we should add the babel-plugin-transform-class-properties plugin to babel.

Most helpful comment

It's already enabled for application code. We don't plan to enable unstable proposals for library code. It creates a ton of churn in the ecosystem when those proposals are dropped or change semantics.

>All comments

It's already enabled for application code. We don't plan to enable unstable proposals for library code. It creates a ton of churn in the ecosystem when those proposals are dropped or change semantics.

Was this page helpful?
0 / 5 - 0 ratings