React-grid-layout: Get warning: "Failed propType: Invalid prop `x` of type `string` supplied to `Draggable`, expected `number`. Check the render method of `GridItem`.

Created on 31 Aug 2015  路  4Comments  路  Source: STRML/react-grid-layout

I got this warning when using ReactGridLayout

Most helpful comment

The error is self-explanatory: you are using the property "x" in the items as if it were a string, but it expects a number:

x: "13" // incorrect
x: 13 // correct

If you are getting the value from a html control, you have to parse it:

x: parseInt(value)

If you are setting it as an attribute, set it as an integer, not a string:

x="13" // incorrect
x={13} // correct

All 4 comments

The error is self-explanatory: you are using the property "x" in the items as if it were a string, but it expects a number:

x: "13" // incorrect
x: 13 // correct

If you are getting the value from a html control, you have to parse it:

x: parseInt(value)

If you are setting it as an attribute, set it as an integer, not a string:

x="13" // incorrect
x={13} // correct

@Puffton thank you

@Puffton Thx .
if i want size % .
am use {"90%"} is not work.

@Puffton Thx .
if i want size % .
am use {"90%"} is not work.

If you want to use percentage, you have to make it a string
eg. size="90%"
This approach should work

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ConfigurableUIComponents picture ConfigurableUIComponents  路  4Comments

Francismb picture Francismb  路  4Comments

larrydahooster picture larrydahooster  路  3Comments

victor-unsw picture victor-unsw  路  3Comments

moritzschaefer picture moritzschaefer  路  3Comments