render() {
    if (this.props.children instanceof Function) {
      return this.props.children({
        isVisible: this.state.isVisible,
        visibilityRect: this.state.visibilityRect
      });
    }
    return React.Children.only(this.props.children);
  }
Check if the element is within the visible viewport