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)))