gpt4 book ai didi

javascript - (Material-ui/React) Prop 类型失败 : Invalid prop `cellHeight` supplied to `GridList`

转载 作者:行者123 更新时间:2023-11-30 14:46:40 25 4
gpt4 key购买 nike

warning.js:33 Warning: Failed prop type: Invalid prop cellHeight supplied to GridList.

我收到此错误,但该属性有效。无论如何要摆脱这个?

这是来自 material-ui 的网格列表文档: http://www.material-ui.com/#/components/grid-list

cellHeight: 180(默认)

在我的代码中的使用:

<div className="images-tile">
<GridList cols={4} cellHeight="120">
{generateTiles(imagesArray)}
</GridList>
</div>

视觉上(有效)

enter image description here

但是得到这个错误

enter image description here

最佳答案

Material UI 的 Gridlist 组件采用数字作为 cellHeight

所以你应该能够做这样的事情:

<div className="images-tile">
<GridList cols={4} cellHeight={120}>
{generateTiles(imagesArray)}
</GridList>
</div>

关于javascript - (Material-ui/React) Prop 类型失败 : Invalid prop `cellHeight` supplied to `GridList` ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48812626/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com