-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Mixing component import syntax breaks components in version 4.12.0 #27147
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same here, using Next JS. The production build seems fine tho. |
Same here. |
Yes my production builds are also breaking any update on this issue ? @mui |
It looks like the same issue as in #24206 (v5). The generated paths are wrong when we build with Windows: https://unpkg.com/browse/@material-ui/[email protected]/Accordion/package.json {
"sideEffects": false,
"module": "..\\esm\\Accordion\\index.js",
"typings": "./index.d.ts"
} vs. https://unpkg.com/browse/@material-ui/[email protected]/Accordion/package.json {
"sideEffects": false,
"module": "../esm/Accordion/index.js",
"typings": "./index.d.ts"
} As similar fix to #24223 should do it. |
It's fixed in v4.12.1. Prove - https://codesandbox.io/s/gallant-http-khu11?file=/src/App.js Thanks for reporting and helping out debug the issue. |
Uh oh!
There was an error while loading. Please reload this page.
Current Behavior 😯
Lots of issues when mixing different import statement syntax in the latest release (4.12.0).
For example, when importing components using the
import { component } from '@material-ui/core'
syntax, and importing another component (for example aTable
) usingimport Table from '@material-ui/core/Table'
and setting thestickyHeader
property to true on aTable
component should make the table header.. well, sticky but it doesn't!Expected Behavior 🤔
Setting the
stickyHeader
property to true on aTable
component should make the table header sticky.Setting a property on a component should work properly, regardless of the import statement syntax.
Steps to Reproduce 🕹
Steps:
import { component } from '@material-ui/core';
syntax;import Table from '@material-ui/core/Table';
Example using
Table
,TableCell
,TableBody
,TableHead
andTableRow
components, setting thestickyHeader
property totrue
on theTable
component and it not working at all:https://codesandbox.io/s/sweet-water-gjq15?file=/src/App.js
Things are breaking if you inspect the table cells, having wrong classes in relation to the properties that are set on the
Table
component.Here's how to make it 'work' as intended:
https://codesandbox.io/s/ecstatic-smoke-q2vz0?file=/src/App.js
There's only a singular difference between the two examples: the import statement.
Context 🔦
Importing components one way or the other is generally something the IDE does for you, and since this is mostly automatic, sometimes the different import styles are mixed, and as such, with the latest version of MUI, you get lots and lots of issues when running your application. This issue is not exclusive to the
Table
component. From my limited testing, this issue also applies toSelect
components for example and I'm sure many more.Your Environment 🌎
The text was updated successfully, but these errors were encountered: