Skip to content

Uncaught Error: A valid ReactComponent must be returned. #6

@ArnoBuschmann

Description

@ArnoBuschmann

Hi :)

When I use your component, I get this error message:

Uncaught Error: A valid ReactComponent must be returned.

Figured, this happens because React is considering the component only valid if its enclosed in div tags. So when changing your code as below, things work properly well.

    return (
      <div>
        <img
          {...this.props}
          style={style}
          src={this.props.src}
          onLoad={this.fadeIn}
        />
      </div>
    )

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