Skip to content Skip to sidebar Skip to footer

How To Enable Support For Class Properties In The Latest Version Babeljs?

Does anyone know how to enable support for properties of a class in the latest version BabelJS? import React from 'react'; import {Component} from 'react'; export default class

Solution 1:

With Babel 6, you use the syntax-class-properties plugin, by installing it:

npm install babel-plugin-syntax-class-properties

and adding it to your .babelrc:

{"plugins":["syntax-class-properties"]}

Post a Comment for "How To Enable Support For Class Properties In The Latest Version Babeljs?"