function useContainerPosition(elementRef, deps) {
    if (deps === void 0) {
      deps = emptyArr
    }

    var _React$useState = React.useState({
        offset: 0,
        width: 0,
      }),
      containerPosition = _React$useState[0],
      setContainerPosition = _React$useState[1]

    usePassiveLayoutEffect(function () {
      var current = elementRef.current

      if (current !== null) {
        var offset = 0
        var el = current

        do {
          offset += el.offsetTop || 0
          el = el.offsetParent
        } while (el)

        if (
          offset !== containerPosition.offset ||
          current.offsetWidth !== containerPosition.width
        ) {
          setContainerPosition({
            offset: offset,
            width: current.offsetWidth,
          })
        }
      } // eslint-disable-next-line react-hooks/exhaustive-deps
    }, deps)
    return containerPosition
  }
/**
   * A hook for measuring the width of the grid container, as well as its distance
   * from the top of the document. These values are necessary to correctly calculate the number/width
   * of columns to render, as well as the number of rows to render.
   *
   * @param elementRef A `ref` object created by `React.useRef()`. That ref should be provided to the
   *   `containerRef` property in `useMasonry()`.
   * @param deps You can force this hook to recalculate the `offset` and `width` whenever this
   *   dependencies list changes. A common dependencies list might look like `[windowWidth, windowHeight]`,
   *   which would force the hook to recalculate any time the size of the browser `window` changed.
   */
A hook for measuring the width of the grid container, as well as its distance
from the top of the document. These values are necessary to correctly calculate the number/width
of columns to render, as well as the number of rows to render.

@param elementRef A `ref` object created by `React.useRef()`. That ref should be provided to the
`containerRef` property in `useMasonry()`.
@param deps You can force this hook to recalculate the `offset` and `width` whenever this
dependencies list changes. A common dependencies list might look like `[windowWidth, windowHeight]`,
which would force the hook to recalculate any time the size of the browser `window` changed.
A hook for measuring the width of the grid container as well as its distance from the top of the document . These values are necessary to correctly calculate the number / width of columns to render as well as the number of rows to render . @param elementRef A ` ref ` object created by ` React . useRef () ` . That ref should be provided to the ` containerRef ` property in ` useMasonry () ` . @param deps You can force this hook to recalculate the ` offset ` and ` width ` whenever this dependencies list changes . A common dependencies list might look like ` [ windowWidth windowHeight ] ` which would force the hook to recalculate any time the size of the browser ` window ` changed .
function useContainerPosition(elementRef, deps) {
    if (deps === void 0) {
      deps = emptyArr
    }
    var _React$useState = React.useState({
        offset: 0,
        width: 0,
      }),
      containerPosition = _React$useState[0],
      setContainerPosition = _React$useState[1]
    usePassiveLayoutEffect(function () {
      var current = elementRef.current
      if (current !== null) {
        var offset = 0
        var el = current
        do {
          offset += el.offsetTop || 0
          el = el.offsetParent
        } while (el)
        if (
          offset !== containerPosition.offset ||
          current.offsetWidth !== containerPosition.width
        ) {
          setContainerPosition({
            offset: offset,
            width: current.offsetWidth,
          })
        }
      } 
    }, deps)
    return containerPosition
  }
function useContainerPosition ( elementRef , deps ) { if ( deps === void 0 ) { deps = emptyArr } var _React$useState = React . useState ( { offset : 0 , width : 0 , } ) , containerPosition = _React$useState [ 0 ] , setContainerPosition = _React$useState [ 1 ] usePassiveLayoutEffect ( function ( ) { var current = elementRef . current if ( current !== null ) { var offset = 0 var el = current do { offset += el . offsetTop || 0 el = el . offsetParent } while ( el ) if ( offset !== containerPosition . offset || current . offsetWidth !== containerPosition . width ) { setContainerPosition ( { offset : offset , width : current . offsetWidth , } ) } } } , deps ) return containerPosition }
A hook for measuring the width of the grid container, as well as its distance
 from the top of the document.
A hook for measuring the width of the grid container as well as its distance from the top of the document .
// eslint-disable-next-line react-hooks/exhaustive-deps