content: import React, { Component } from 'react';
  import PropTypes from 'prop-types';
  import stylePropType from 'react-style-proptype';
  import withOffsets from './OffsetProvider';
  
  class Bounds extends Component {
    render() {
      const {
        children,
        initRef,
        subscribe,
        unsubscribe,
        className,
        style,
      } = this.props;
  
      return (
        <div
          ref={(node) => {
            initRef(node);
          }}
          className={className}
          style={style}
        >
          {React.cloneElement(children, {
            subscribe,
            unsubscribe,
            isBounded: true,
          })
          }
        </div>
      );
    }
  }
  
  Bounds.propTypes = {
    children: PropTypes.node.isRequired,
    initRef: PropTypes.func.isRequired,
    subscribe: PropTypes.func.isRequired,
    unsubscribe: PropTypes.func.isRequired,
    className: PropTypes.string,
    style: stylePropType,
  };
  
  Bounds.defaultProps = {
    className: '',
    style: {}
  };
  
  export default withOffsets(Bounds);
  