When working with Typescript, I encountered an error related to spacing values:
TS2322: Type 'number' is not assignable to type 'boolean | 7 | 2 | 10 | 1 | 3 | 4 | 5 | 6 | 8 | "auto" | 9 | 11 | 12'.
No lint errors found
Version: typescript 3.5.2, tslint 5.14.0
I needed to dynamically set the xl, lg, ... and so on
properties while iterating over an array:
<Grid container spacing={2}>
{row.map(resumeItem =>
<Grid key={resumeItem.id} item xs={12} lg={6} xl={resumeItem.space}>
...
</Grid>
)}
</Grid>
It's worth mentioning that the space
property is always a number!