From b595ed0ae0b1563e2b15568047d32531d221fe6e Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Fri, 22 Jun 2018 18:01:35 +0530 Subject: [PATCH] GridArea - Make class vars static + change arg obj to getAttributeScale --- src/grid-area.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/grid-area.tsx b/src/grid-area.tsx index d2fd8e6..6d8c099 100644 --- a/src/grid-area.tsx +++ b/src/grid-area.tsx @@ -47,11 +47,11 @@ const GridAreaPropTypes = { }; class GridArea extends PureComponent { - displayName = 'GridArea'; - propTypes = GridAreaPropTypes; - defaultProps = {}; + static displayName = 'GridArea'; + static propTypes = GridAreaPropTypes; + static defaultProps = {}; - requiresSVG = true; + static requiresSVG = true; render() { const { @@ -67,7 +67,13 @@ class GridArea extends PureComponent { const tickYAttr = isVertical ? 'x' : 'y'; const length = isVertical ? height : width; - const scale = getAttributeScale(this.props, 'y'); + const scale = getAttributeScale({ + ...this.props, + width, + height, + top, + left + }, 'y'); const values = [[4, 5.76], [8.5, 11.25]]; return (