Leon Gaban
Leon Gaban

Reputation: 39018

(Material-ui / React) Failed prop type: Invalid prop `cellHeight` supplied to `GridList`

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

I'm getting this error, yet the property worked. Is there anyway to get rid of this?

Here is the documentation for Grid List from material-ui: http://www.material-ui.com/#/components/grid-list

cellHeight: 180(default)

The use in my code:

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

Visually (It works)

enter image description here

However getting this Error

enter image description here

Upvotes: 1

Views: 3447

Answers (1)

jenkizenki
jenkizenki

Reputation: 798

Material UI's Gridlist component takes a number for the cellHeight

So you should be able to do something like this:

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

Upvotes: 3

Related Questions