meteor / react-packages

Meteor packages for a great React developer experience
http://guide.meteor.com/react.html
Other
573 stars 158 forks source link

Only one default export allowed per module #204

Closed jbrozena22 closed 3 years ago

jbrozena22 commented 8 years ago

After upgrading from Meteor 1.4.2-rc9 to 1.4.2 I received a whole bunch of these errors:

Only one default export allowed per module. (74:0)

The problem is in each of my .JSX files where I am using createContainer I have:

export default class ChooseActivity extends Component {
  constructor(props) {
    super(props);
    this.state = {
    }
  }

  componentDidMount() {
  }

  render() {
   ...
   }
}

export default ChooseActivityContainer =  createContainer(() => {

  return {
  }
}, ChooseActivity)

This has worked fine to date but something in the update is now preventing a .JSX file from having multiple export default statements. This SO question makes me think this is as designed and the reasoning makes sense.

However, does this mean I need to be adding a file for each .jsx file where I use createContainer? As In I would have ChooseActivity.jsx and ChooseActivityContainer.jsx? Is there another recommended method for how to export the container without needing a separate file?

Thanks in advance for the help.

filipenevola commented 3 years ago

I'm closing this just because it's too old. We can open new issues for items that are still valid.

Most of these items were solved already or replaced by new strategies (like hooks)