我正在使用GridList
将网格中的100张.svg
图像可视化。由于灵活的分辨率要求,该网格应该能够自行调整。因此,我想到了这个:
render(){
return (
<GridList cellHeight="100%" cols={colSize}>
{representatives.map((element) => this.renderTile(element))}
</GridList>
);
}
renderTile(element) {
return (
<GridListTile key={element.id}>
<img className={classes.gridTile} src={element.type == "square" ? SquareLogo : CircleLogo} alt="icon" />
</GridListTile>);
}
从视觉上讲,它确实可以满足我的需求。但这会导致错误:
Warning: Failed prop type: Invalid prop `cellHeight` supplied to `ForwardRef(GridList)`.
Warning: `NaN` is an invalid value for the `height` css style property.
我可以拥有此设置的确切行为而没有错误吗?怎么样?