Hi guys, I’m running Meteor version 1.4.2
and react-redux
version 4.4.5
on my project, and when I try to use the @connect
decorator from the react-redux
package nothing happens, it simply doesn’t run. Here’s my code:
import { Meteor } from 'meteor/meteor';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import ArticleEditor from '../../pages/ArticleEditor.jsx';
@connect((store) => {
console.log("@connect running");
return { articles: store.articles }
})
export default class ArticleEditorContainer extends Component {
componentWillMount() {
this.sub = Meteor.subscribe('articles');
}
componentWillUnmount() {
this.sub.stop();
}
render() {
return <ArticleEditor {...this.props} />;
}
}
And when I check with the ReactDevTools there’s no sign of the @connect wrapper. However, it does work when I use it like that:
import { connect } from 'react-redux';
class ArticleEditorContainer extends Component {
componentWillMount() {
this.sub = Meteor.subscribe('articles');
}
componentWillUnmount() {
this.sub.stop();
}
render() {
return <ArticleEditor {...this.props} />;
}
}
export default connect((store) => { /* ... */ })(ArticleEditorContainer);
Is there a way to make the decorator work? Or ES7 decorators aren’t supported at all?