cachedHeight: PropTypes.number,
onHeightChange: PropTypes.func,
children: PropTypes.node,
+ currentlyViewing: PropTypes.number,
+ updateCurrentlyViewing: PropTypes.func,
};
state = {
);
this.componentMounted = true;
+
+ if(id === this.props.currentlyViewing) this.node.scrollIntoView();
}
componentWillUnmount () {
handleIntersection = (entry) => {
this.entry = entry;
+ if(entry.intersectionRatio > 0.75 && this.props.updateCurrentlyViewing) this.props.updateCurrentlyViewing(this.id);
+
scheduleIdleTask(this.calculateHeight);
this.setState(this.updateStateAfterIntersection);
}