[theme] TypeError: `theme.spacing` is not a function when using Chakra UI theme with Material UI theme & MUI X DataGrid
@brijeshb42 is already working on this.
Since Sep 5, 2023.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/p/sandbox/create-next-app-example-forked-ktl63y?file=/pages/index.js:1,1
Steps:
- follow this guide: https://mui.com/material-ui/guides/styled-engine/#using-with-chakra-ui to be able to use chakraui theme with mui theme.
- Render component from '@mui/x-data-grid'; with
checkboxSelection=trueprop - Select one of the checkboxes
Current behavior 😯
I am getting 'typeError: theme.spacing is not a function'
Expected behavior 🤔
I should be able to select/unselect rows through the checkboxes normally
Context 🔦
I have an app where the main theme used is chakraui. On one page I want to use the material ui data grid component. & I tried theme scoping and it didn't show any errors or strange ui when the table was rendered however when I tried selecting a row using the check boxes I got the error "theme.spacing is not a fn".
I have seen that theme scoping was tacked in this issue: https://github.com/mui/material-ui/issues/25852 & I have implemented the solution stated in the docs but it is not working for my case.
Your environment 🌎
npx @mui/envinfo
```
- System:
-
OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa) - Binaries:
-
Node: 18.14.2 - ~/.nvm/versions/node/v18.14.2/bin/node -
Yarn: 1.22.19 - /usr/local/bin/yarn -
npm: 9.5.0 - ~/.nvm/versions/node/v18.14.2/bin/npm - Browsers:
-
Chrome: 113.0.5672.126 - npmPackages:
-
@emotion/react: ^11.11.1 => 11.11.1 -
@emotion/styled: ^11.11.0 => 11.11.0 -
@mui/base: 5.0.0-beta.13 -
@mui/core-downloads-tracker: 5.14.7 -
@mui/material: ^5.14.0 => 5.14.7 -
@mui/private-theming: 5.14.7 -
@mui/styled-engine: 5.14.7 -
@mui/system: 5.14.7 -
@mui/types: 7.2.4 -
@mui/utils: 5.14.7 -
@mui/x-data-grid: ^6.12.0 => 6.12.1 -
@mui/x-date-pickers: ^6.10.0 => 6.12.1 -
@types/react: 18.2.21 -
react: ^18.2.0 => 18.2.0 -
react-dom: ^18.2.0 => 18.2.0 -
typescript: 5.2.2
</details>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.