Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ArnoBuschmann opened this issue Apr 11, 2016 · 4 comments
Open

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

ArnoBuschmann opened this issue Apr 11, 2016 · 4 comments

Comments

@ArnoBuschmann
Copy link

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>
    )
@zackify
Copy link
Member

zackify commented Apr 11, 2016

I made this a while ago, I'll check it out and update it tonight!
On Mon, Apr 11, 2016 at 19:36 ArnoBuschmann [email protected]
wrote:

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>
)


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#6

@ArnoBuschmann
Copy link
Author

Yep. It's useful, thanks for creating it.

@zackify
Copy link
Member

zackify commented Apr 13, 2016

I don't see this happening at all after testing. Any way you could provide a stack trace or some more code?

@zackify
Copy link
Member

zackify commented Apr 15, 2016

I'm going to close this in a couple days if no reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants