cedricdelpoux / react-responsive-masonry

React responsive masonry component built with css flexbox
https://cedricdelpoux.github.io/react-responsive-masonry/
MIT License
362 stars 37 forks source link

Gives warning of invalid gutter type, but works with invalid gutter value only! #49

Closed IAmRC1 closed 2 years ago

IAmRC1 commented 3 years ago

So, I get this warning when giving gutter as number Warning: Failed prop type: Invalid propgutterof typenumbersupplied toMasonry2, expectedstring. But the gutter value takes effect only when its number and not a string.

Usamaahmad751 commented 3 years ago

Basically, you have to put the unit with the values for example 20pxor 1.5rem. 20 as a number will work but 20 as a string will not work unless you put a unit with it. The purpose of the string value implementation is to provide the choice to the user so they can use a wide range of units with any value. Hope you will get it.

cedricdelpoux commented 2 years ago

Thank you for the explanation @Usamaahmad751 👍🏻