Open charmsRace opened 1 year ago
Hello @charmsRace,
Thank you for letting us know about this issue. We decided to investigate it further in the following bug report: Reactive - theme.spacing returns NaNpx
when a negative sign is used before it. We will update that thread once we have any news.
Is there an existing issue for this?
I'm using ...
React Grid
Current Behaviour
In
<TableTreeExpandButton />
(and presumably elsewhere), you have setmarginLeft: -theme.spacing(1)
. As of MUI v5, this is incorrect —theme.spacing
now returns a string with the suffix'px'
(cf. migration notes). This means-theme.spacing(1)
evaulates to e.g.-'16px'
, which isNaN
. On the client, this ends up asmarginLeft: NaNpx
and is ignored.Looking through the bundled code in my
node_modules/
and searching for-theme\.spacing\(\d+\)
, I see this is also in<TableTreeCheckbox />
. Anywhere the result oftheme.spacing
is treated as a number needs to be fixed.Expected Behaviour
DX components should correctly calculate margins instead of declaring
NaN
.Steps to Reproduce
Look at your code, or inspect this component's styling in literally any runtime environment.
Environment