forceCheck doesnt load items that are already in viewport
See original GitHub issueCurrent implementation:
/**
*
* CoverPhoto
*
*/
import React from 'react';
import classnames from 'classnames/bind';
import DebugHelper from 'utils/debug';
import LazyLoad, { forceCheck } from 'react-lazyload';
import styles from './CoverPhoto.styl';
const cx = classnames.bind(styles);
const debug = new DebugHelper('components/CoverPhoto');
export class CoverPhoto extends React.Component {
componentDidMount () {
forceCheck();
}
render () {
// const CoverPhoto = (props) => {
debug('render');
const { props } = this;
const className = cx(props.className, {
coverPhoto: true,
hasRatio: props.ratio,
[`ratio-${props.ratio}`]: props.ratio,
});
const imgProps = {
src: props.src,
alt: props.alt,
};
return (
<div className={className}>
<LazyLoad
height={props.height || 100}
offset={300}
once
>
<img
{...imgProps}
className={styles.photo}
role="presentation"
/>
</LazyLoad>
</div>
);
}
}
export default CoverPhoto;
CoverPhoto
is then used in other components, like a ProductCard
:
Though forceCheck
is called, the image is not loaded even though ProductCard is already inside the viewport.
By looking at the log, somehow componentDidMount
is being called before render()
. Is that becuase the component is not fully mounted till LazyLoad
finish rendering? Any hint on how this can be?
Issue Analytics
- State:
- Created 6 years ago
- Comments:21
Top Results From Across the Web
Facecheck Troubleshooting - Overwolf Support
This may occur when either: The app's auto launch setting is set to Off; The auto launch permission of the app is set...
Read more >Facecheck doesn't work : r/Overwolf - Reddit
I really need some help because FaceCheck helps me spot good targets to easy kill(in terms of jgling and roaming) because I know...
Read more >Troubleshooting - Facecheck - Medium
Close and re-open Facecheck after a few seconds. Loading takes forever. The team stats or in-game loading takes forever. This can happened when ......
Read more >Facecheck League of Legends App Review December 2021
facecheck league of legends app review. This video is a personal review of the league of legends app FaceCheck powered by Overwolf.
Read more >Facecheck is BACK! "C9 and Rogue Both Making it ... - YouTube
Facecheck is BACK! Join dGon, LS, and Dom as they discuss the group draw for League of Legends Worlds 2021 and make their...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
setTimeout(forceCheck, 1000)
works 😉 I mistyped the function nameGlad you work it out!