threepointone / redux-react-local

local component state via redux
370 stars 21 forks source link

@local? #21

Open DaveStein opened 8 years ago

DaveStein commented 8 years ago

My compiler blows up at the sight of @local - what special annotation is that?

ctrlplusb commented 8 years ago

It's decorator syntax:

https://github.com/wycats/javascript-decorators/blob/master/README.md

I believe there have been some spec changes of late so babel has dropped support. You can use it as a standard function though.

e..g

export default local(...)(MyComponent);
rosskevin commented 8 years ago

Explanation: http://babeljs.io/docs/plugins/transform-decorators/ Workaround: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy And: http://technologyadvice.github.io/es7-decorators-babel6/

untested but may work for you.