import PropTypes from 'prop-types'; import React, { Component } from 'react'; import classNames from 'classnames'; import { scrollDirections } from 'Helpers/Props'; import styles from './Scroller.css'; class Scroller extends Component { // // Lifecycle constructor(props, context) { super(props, context); this._scroller = null; } componentDidMount() { const { scrollTop } = this.props; if (this.props.scrollTop != null) { this._scroller.scrollTop = scrollTop; } this._scroller.focus({ preventScroll: true }); } // // Control _setScrollerRef = (ref) => { this._scroller = ref; this.props.registerScroller(ref); } // // Render render() { const { className, scrollDirection, autoScroll, children, scrollTop, onScroll, registerScroller, ...otherProps } = this.props; return (