_maybeCalculateCachedStyles(resetAll) {
    const {
      columnWidth,
      enableFixedColumnScroll,
      enableFixedRowScroll,
      height,
      fixedColumnCount,
      fixedRowCount,
      rowHeight,
      style,
      styleBottomLeftGrid,
      styleBottomRightGrid,
      styleTopLeftGrid,
      styleTopRightGrid,
      width,
    } = this.props;

    const sizeChange =
      resetAll ||
      height !== this._lastRenderedHeight ||
      width !== this._lastRenderedWidth;
    const leftSizeChange =
      resetAll ||
      columnWidth !== this._lastRenderedColumnWidth ||
      fixedColumnCount !== this._lastRenderedFixedColumnCount;
    const topSizeChange =
      resetAll ||
      fixedRowCount !== this._lastRenderedFixedRowCount ||
      rowHeight !== this._lastRenderedRowHeight;

    if (resetAll || sizeChange || style !== this._lastRenderedStyle) {
      this._containerOuterStyle = {
        height,
        overflow: 'visible', // Let :focus outline show through
        width,
        ...style,
      };
    }

    if (resetAll || sizeChange || topSizeChange) {
      this._containerTopStyle = {
        height: this._getTopGridHeight(this.props),
        position: 'relative',
        width,
      };

      this._containerBottomStyle = {
        height: height - this._getTopGridHeight(this.props),
        overflow: 'visible', // Let :focus outline show through
        position: 'relative',
        width,
      };
    }

    if (
      resetAll ||
      styleBottomLeftGrid !== this._lastRenderedStyleBottomLeftGrid
    ) {
      this._bottomLeftGridStyle = {
        left: 0,
        overflowX: 'hidden',
        overflowY: enableFixedColumnScroll ? 'auto' : 'hidden',
        position: 'absolute',
        ...styleBottomLeftGrid,
      };
    }

    if (
      resetAll ||
      leftSizeChange ||
      styleBottomRightGrid !== this._lastRenderedStyleBottomRightGrid
    ) {
      this._bottomRightGridStyle = {
        left: this._getLeftGridWidth(this.props),
        position: 'absolute',
        ...styleBottomRightGrid,
      };
    }

    if (resetAll || styleTopLeftGrid !== this._lastRenderedStyleTopLeftGrid) {
      this._topLeftGridStyle = {
        left: 0,
        overflowX: 'hidden',
        overflowY: 'hidden',
        position: 'absolute',
        top: 0,
        ...styleTopLeftGrid,
      };
    }

    if (
      resetAll ||
      leftSizeChange ||
      styleTopRightGrid !== this._lastRenderedStyleTopRightGrid
    ) {
      this._topRightGridStyle = {
        left: this._getLeftGridWidth(this.props),
        overflowX: enableFixedRowScroll ? 'auto' : 'hidden',
        overflowY: 'hidden',
        position: 'absolute',
        top: 0,
        ...styleTopRightGrid,
      };
    }

    this._lastRenderedColumnWidth = columnWidth;
    this._lastRenderedFixedColumnCount = fixedColumnCount;
    this._lastRenderedFixedRowCount = fixedRowCount;
    this._lastRenderedHeight = height;
    this._lastRenderedRowHeight = rowHeight;
    this._lastRenderedStyle = style;
    this._lastRenderedStyleBottomLeftGrid = styleBottomLeftGrid;
    this._lastRenderedStyleBottomRightGrid = styleBottomRightGrid;
    this._lastRenderedStyleTopLeftGrid = styleTopLeftGrid;
    this._lastRenderedStyleTopRightGrid = styleTopRightGrid;
    this._lastRenderedWidth = width;
  }
Avoid recreating inline styles each render; this bypasses Grid's shallowCompare.
This method recalculates styles only when specific props change.