[MaterialUI] Cannot read properties of null (reading 'useContext')
nahimr opened this issue · 4 comments
nahimr commented
When calling useTheme
hook from @mui/material, this throws an error.
Shared dependencies
On host side :
On remote side :
Versions
- vite-plugin-federation: 1.3.5
- vite: 5.2.8
- @emotion/react: 11.11.4
- @emotion/styled: 11.11.5
- @mui/material: 5.15.15
Steps to reproduce
What is Expected?
It's expected to use correctly the hook useContext
that its called by useTheme
.
What is actually happening?
It's missing shared useContext
reference of React.
Related to #595.
Denrox commented
Try adding to package.json following:
"resolutions": {
"react": "18.3.1"
},
Replace react version with yours
mauri2008 commented
Hello nahimr, were you able to resolve this error?