-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Box from @mui/material conflicts with Box from @react-three/drei #29176
Comments
I have the same problem |
Can you please share a repository/codesandbox that we can take a look into? |
https://codesandbox.io/s/ecstatic-leakey-k0nrj?file=/src/App.tsx |
Same issue, though adding a component="div" to Box fixes it. |
This seems more like a workaround than a fix, I don't think I would want to add this to hundreds of my Box components just because I wanted to use the react-three package. Is it possible to have an actual fix for this from mui's side? Or does it have to be from react-three's side |
It appears this has been solved in a recent (~ December) release. Are any of the maintainers able to point me in the direction of what fixed it? We're having the same issue with |
While this approach provide a bit of assistance, it does not a complete solution to the issue at hand. |
Current Behavior 馃槸
If I add
@react-three/drei
package as a dependency, then all my components that useBox
from@mui/material
start producing the following error:Expected Behavior 馃
There should not be any errors.
Steps to Reproduce 馃暪
Steps:
npx create-react-app my-app --template typescript
package.json
npm install
Typescript v4.4.4
src
. I name itThreeRenderer.tsx
:App.tsx
and add aBox
component from@mui/material
.Context 馃敠
I'm using
three js
for some 3D components. But they have no relationship with the components I use from MUI. Basically, they are on different branches in the DOM tree. Moreover, I'm not importing both Box types in the same file. My guess is that the TS engine is somewhat caching bothBox
type representations and then mixes them up in some way or another? That's why in the steps to reproduce I mentioned that a component that usesthree
types should be added.Your Environment 馃寧
`npx @mui/envinfo`
The
tsconfig
that I use:I'm using the
tsversion
from the node modules, i.e.v4.4.4
.NOTE
I did not manage to reproduce this issue in codesandbox. Probably they're using a different TS version and I saw that I'm not able to change it and use the one I want.
The text was updated successfully, but these errors were encountered: