Current state of ES2016 decorators?


#1

Does anyone know if the ES2016 decorator syntax has at least a somewhat dependable future ahead? I just tried using it with the stage-2 babel preset, and got this:

SyntaxError: index.js: Decorators are not officially supported yet in 6.x pending a proposal update.
However, if you need to use them you can install the legacy decorators transform with:

npm install babel-plugin-transform-decorators-legacy --save-dev

and add the following line to your .babelrc file:

{
  "plugins": ["transform-decorators-legacy"]
}

“Legacy”? Sounds like it’s being phased out. Does anyone know what’s up? I was about to use it because I was getting tired of doing things like:

export default Radium(muiThemeable()(SomeOtherWrapper(MyComponent)))

#2

Legacy meaning babel 5.x functionality :slight_smile:

Explanation in repo

Decorators recently advanced to stage 2