question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSSTransitionGroup demo not working with react-lazyload@2.0

See original GitHub issue

I was trying to get the CSSTransitionDemo working as shown here https://jasonslyvia.github.io/react-lazyload/examples/#/fadein

For some reason, although there were no errors, the images would not actually fade in, but would still just “pop in”.

I thought upgrading to v2.0 of react-lazyload might help but instead it showed an error in the console.

Here is my code

<LazyLoad height={233} throttle={300} once>
  <CSSTransitionGroup key="1"
    transitionName="fade"
    transitionAppear
    transitionAppearTimeout={500}
    transitionEnter={false}
    transitionLeave={false}>
    { Card.generateImage(this.props.imgSource, this.props.imgAlt) }
  </CSSTransitionGroup>
</LazyLoad>

Here is the error I am seeing in the browser

6warning.js:33 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 `Card`.
    in Card (created by EventsList)
    in div (created by EventsList)
    in div (created by EventsList)
    in div (created by EventsList)
    in EventsList (created by NavigationBar)
    in div (created by NavigationBar)
    in div (created by TabPane)
    in Transition (created by Fade)
    in Fade (created by TabPane)
    in TabPane (created by Tab)
    in Tab (created by NavigationBar)
    in div (created by TabContent)
    in TabContent (created by Tabs)
    in div (created by Tabs)
    in TabContainer (created by Tabs)
    in Tabs (created by Uncontrolled(Tabs))
    in Uncontrolled(Tabs) (created by NavigationBar)
    in div (created by NavigationBar)
    in div (created by NavigationBar)
    in NavigationBar (created by Home)
    in div (created by Home)
    in Home (created by Bootstrap)
    in div (created by Bootstrap)
    in Bootstrap

Thanks for this great package, the <LazyLoad> component is working quite well for!

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
fabioimpecommented, Apr 9, 2018

faced the same issue even after the migration guide of react-transition-group, no errors on console but the image just pop in as thescientist13 reported

0reactions
alextouzelcommented, Jul 25, 2019

Sure. I made a sandbox demonstrating the issue.

In the sandbox, click the button twice to see the problem with the animation. Then, you can go to “ViewWithLazyLoad.js” and comment out the LazyLoad component. Run the animation again and everything should be fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React CSSTransitionGroup is not working (doesn't add classes)
I am currently working on notification component in React. It is working except the transitions.. Somehow its not even adding class.
Read more >
CSSTransitionGroup does not animate if child calls ... - GitHub
The problem in my case was that I had hidden the parent container with display:none and was attempting to fade it in, but...
Read more >
React Transition Group Demo (forked) - StackBlitz
A create-react-app project based on react, react-dom, react-addons-css-transition-group and @types/react-addons-css-transition-group.
Read more >
react-transition-group - npm
A react component toolset for managing animations. Latest version: 4.4.5, last published: 5 months ago. Start using react-transition-group ...
Read more >
How to use React CSS Transition Group for Animations
Learn more advanced front-end and full-stack development at: https://www.fullstackacademy.comIn this video, Corryn Young explores how to use ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found