joshwnj / joshwnj/react-visibility-sensor

"React.createElement: type is invalid" after upgrading to 5.0

Open
#144 7 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.3k
Forks
192
PR merge metrics
No merged PRs in 30d

Description

Code works fine with version 4.1.3, but raises an error in 5.0:

```
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `ThumbnailImage`.
in ThumbnailImage (created by ThumbnailColumn)
in div (created by ThumbnailColumn)
in div (created by Box)
in Box (created by withHelpersModifiers(Box))
in withHelpersModifiers(Box) (created by ThumbnailColumn)
in div (created by ThumbnailColumn)
in ThumbnailColumn (created by Connect(ThumbnailColumn))
in Connect(ThumbnailColumn) (created by AssetPage)
in div (created by AssetPage)
in div (created by AssetPage)
in AssetPage (created by Route)
in Route (created by App)
in div (created by App)
in Router (created by ConnectedRouter)
in ConnectedRouter (created by App)
in App
in Provider
```

Using Electron 1.8.8 (Node.js v8.2.1), react(-dom) 16.6.3. Code looks like this:

```javascript
const figure = (

hello
)
return React.createElement(VisibilitySensor, {
onChange: this.onVisibilityChange,
partialVisibility: true
}, figure)
```

I substituted the example from the README, but that didn't make a difference.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.