StackOverflow - javascript, reactjs, airbnb-js-styleguide
How do I rewrite a react component with decorators as a pure function?
Ok, so the problem is the es7 style decorators. Desugaring them solves the problem: import React from 'react'; import { observer } from 'mobx-react'; import cssmodules from 'react-css-modules'; import styles from './index.css'; import Select from '../Select/'; import List from '../List/'; function Analysis(props) { return ( ); } Analysis.propTypes = { store: React.PropTypes.object.isRequired, }; export default cssmodules(observer(Analysis), styles); It's not pretty, but it does work and it doesn't trigger any errors.
Was this helpful?
Related Articles
Have a different question?
Can't find the answer you're looking for? Submit your own question to our community.
🛎️ Get Weekly OTA Fixes
New answers, vendor issues, and updates — straight to your inbox.