Skip to content

Redux connect support #80

@maximelebastard

Description

@maximelebastard

Hi,

I have a React/Redux app that I'd like to document. With redux, I use the connect() function.

But when I use it, react-docgen cannot find a valid component in my file.

This works:

const Contributors = React.createClass({...});
export default Contributors;

This does not:

const Contributors = React.createClass({...});
const mapStateToProps = (state) => {
  return { contributors: state.contributors }
}
export default connect(mapStateToProps)(Contributors);

I found a workaround by appending this to the end of file, but I don't know if it will not break something later:

module.exports = Contributors;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions