Link:
1.
2.
3.
4.
| Tech | Version |
|--------------|---------|
| Material-UI | v3.?.? |
| React | |
| Browser | |
| TypeScript | |
| etc. | |
@ask2mahtab Please provide a full reproduction test case. This would help a lot 馃懛 .
A live example would be perfect. This codesandbox.io template _may_ be a good starting point. Thank you!
Hi @ask2mahtab! I have had the same problem.
Please check your styles object in your components, because theme.spacing
generate the warning.
Let me know!
'Expected spacing argument to be a number, got [object Object]'
I was getting this too. Upgraded from Material UI 3.9.3 to 4.1.1.
The mistake was simple. In MUI v3, we could do:
theme.spacing.unit
Upgrading to 4.1.1, I removed the .unit
to be:
theme.spacing
That was wrong though, and it was what was causing the warning. The correct change is to:
theme.spacing()
It's a small mistake, but hopefully this helps anyone else running into this issue.
Most helpful comment
'Expected spacing argument to be a number, got [object Object]'
I was getting this too. Upgraded from Material UI 3.9.3 to 4.1.1.
The mistake was simple. In MUI v3, we could do:
Upgrading to 4.1.1, I removed the
.unit
to be:That was wrong though, and it was what was causing the warning. The correct change is to:
It's a small mistake, but hopefully this helps anyone else running into this issue.