Code Monkey home page Code Monkey logo

Comments (13)

vramana avatar vramana commented on May 3, 2024

@sbaechler You probably are not passing down the props into your React component. Can you see the discussion in #73 helps ??

from react-slick.

sbaechler avatar sbaechler commented on May 3, 2024

No, I was using a wrapper div. But even with passing down the props the problem still exists.

from react-slick.

vramana avatar vramana commented on May 3, 2024

@sbaechler Can you write an example so the I can reproduce the issue?

from react-slick.

sean-shilin avatar sean-shilin commented on May 3, 2024

I got a quick hack to the same issue -> #95

from react-slick.

phil-lauffenburger avatar phil-lauffenburger commented on May 3, 2024

I'm having a similar issue:

Hey, here's an example of the problem I'm having:

getVidElement: function (vidId) {

var video = this.props.Annotation[vidId];

var vidElement;


  vidElement = <Video video={video} />;

return (<div   key ={video.id.objectId} >
    {vidElement}
    </div>);
 },

 render: function () {
       var vidElements = this.getListOfVidIds().map(this.getVidElement);
       var settings = {
       dots: true,
       infinite: true,
       lazyLoad:true,
        arrows:true,
       speed: 500,
      slidesToShow: 3,
      slidesToScroll: 3
};

return (
  <Slider {...settings} >
    {vidElements}

  </Slider>
);
  }

Even if I pass {...this.props} to both the

tags, I still can't get anything initialized. It is 'lazyloading' the entire {vidElements} array. When I click the arrows or the dots, everything is loaded.

from react-slick.

phil-lauffenburger avatar phil-lauffenburger commented on May 3, 2024

Ok, so I removed an unnecessary level of children and it still doesn't work...:

getListOfVidIds: function () {
return Object.keys(this.props.Annotation);
 },


  getVidElement: function (vidId) {

var video = this.props.Annotation[vidId];


var vidElement;


  vidElement = <div 
  onClick = {this.props.handleThumbnailClick.bind(null, this, video)}
       onMouseOver = {this.handleMouseOver}  
         onMouseOut = {this.handleMouseOut} 
         style={videoStyle}
      >
      <h3>{video.description}</h3>
      <h5>{video.hashtags}</h5>
      </div>;

return (<div  key ={video.id.objectId} >
    {vidElement}
    </div>
       );

  },


  render: function () {



    var vidElements = this.getListOfVidIds().map(this.getVidElement);

    var slidesScroll = 3
    if (vidElements.length <4 ){
      slidesScroll = 1  
    }
var settings = {
dots: true,
    lazyLoad: true,
  infinite: true,
    arrows:true,
  speed: 500,
  slidesToShow: slidesScroll,
  slidesToScroll: slidesScroll
};

return (
  <Slider {...settings} >
    {vidElements}

  </Slider>
);

 }

});

from react-slick.

phil-lauffenburger avatar phil-lauffenburger commented on May 3, 2024

I'd really like to resolve this problem in my app. Is there anything further I could do?

from react-slick.

akiran avatar akiran commented on May 3, 2024

I will try to fix it soon

from react-slick.

lusilva avatar lusilva commented on May 3, 2024

Any update on this? I'm also having this issue

from react-slick.

orthotypos avatar orthotypos commented on May 3, 2024

Same here. Seeing the same issue.

from react-slick.

w3jimmy avatar w3jimmy commented on May 3, 2024

Same here. It's been a while since you posted, I wonder what were your workarounds, guys?

from react-slick.

jamaljeantobias avatar jamaljeantobias commented on May 3, 2024

I still have this same issue

from react-slick.

laveesingh avatar laveesingh commented on May 3, 2024

I think most lazyloading related issues have been fixed. (latest release 0.19.0)
Please refer to this codesandbox example: https://codesandbox.io/s/n9p51n1lo0
If someone still has any problem regarding this, please generate a demo on codesandbox, and feel free to request reopen.

from react-slick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.