Skip to content
Sen Yang edited this page Aug 2, 2016 · 4 revisions

From 1.x to 2.x

The biggest change from 1.x to 2.x is that your component no longer receives visible or firstTimeVisible as props. So how can your component tell whether it is visible or not? Simple, once your component has been rendered(lifecycle methods been called), it must be visible.

In the first round of rendering, LazyLoad never renders your component, instead it will render a placeholder with height specified by props. Then LazyLoad will run checkVisible for every instance to determine which components should be rendered truly.

So bear in mind that a proper height props for LazyLoad will improve the performance for LazyLoad very much.

  • set height props to <LazyLoad> component, or pass them as parameter if you used @lazyload() decorator.
  • remove wheel or mousewheel props, it's not longer needed. If you want to lazy load some stuff inside a overflow container, try set overflow props.
Clone this wiki locally