You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given an application built with MUI, one wants to reuse some of the components and views in another application.
The first app gets linked locally with npm link
The second application is linking the first app in with npm link firstapp
The second app can't use the components from the first app that are including MUI components. Something related the hooks not being used right is popping out.
The issue is present in the latest release.
I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
The application importing custom published components that include MUI , crashes with:
Error: Invalid hook call. Hooks can only be called inside of the body of a function
component. This could happen for one of the following reasons:
You might have mismatching versions of React and the renderer (such as React DOM)
I have read the error.
I am not breaking the hook rules.
I am using exactly the same versions of all dependencies including React and Reactt Dom.
I dont have more React apps in the same time.
Also , the same flow with a component that is rendering a simple dom doesn't have the issue.
I might be wrong at some level but is not that obvious or direct.
Given an application built with MUI, one wants to reuse some of the components and views in another application.
The first app gets linked locally with
npm link
The second application is linking the first app in with
npm link firstapp
The second app can't use the components from the first app that are including MUI components. Something related the hooks not being used right is popping out.
Current Behavior 😯
The application importing custom published components that include MUI , crashes with:
However, the components that are not including MUI are working just fine.
Sample code is available here: https://github.com/bluehipy/code4fun/tree/master/mui-test
Expected Behavior 🤔
The imported components that contain some MUI components should render correctly without triggering the hook error.
Steps to Reproduce 🕹
test_a
npm link
intest_a
root pathtest_b
npm link test_a
<TestComponent />
https://github.com/bluehipy/code4fun/tree/master/mui-test
Context 🔦
I am trying to reuse components from an application into a another application.
Your Environment 🌎
`npx @mui/envinfo`
The text was updated successfully, but these errors were encountered: