After a migration to the 3.6.1 version and when I open a Modal. I have the following error:

data.style is undefined

I think wee need to check if data.style exists or not (?)
| Tech | Version |
|--------------|---------|
| Material-UI | v3.6.1 |
| React | 16.6.3 |
| Browser | |
| TypeScript | |
| etc. | |
related to #13733
It looks like a regression. Can somebody provide a reproduction? It would help, a lot. Thank you!
I faced this error once - right after updated the lib to 3.6.1
But then I've tried to reproduce it for @oliviertassinari in codesandbox and everything worked fine
also it disappeared from my project after I cleaned modules cache and rm -rf node_modules; yarn install
โ โ npm ls @material-ui/core version
[email protected] /path
โโโ @material-ui/[email protected]
it's rather a human factor than an issue with the lib
cannot reproduce
we can reproduce it with this test. just add an unsupported property to the Modal component.
React raise this warning : Warning: React does not recognize theunsupportedPropprop on a DOM element.... . This warning causes this error after unmounting the Modal component.
const wrapper = mount(
<Modal open={false} unsupportedProp="unsupported">
<div />
</Modal>,
);
wrapper.setProps({ open: true });
wrapper.unmount();
This React warning shouldn't raise this error...
@amensouissi
See https://material-ui.com/api/modal/#props below the props table:
Any other properties supplied will be spread to the root element (native element).
It's a common pattern in material-ui components that additional props are spread to a documented child component. In this case it's a DOM node and the warning therefore correct.
@eps1lon
yes the warning is correct. but it must not cause the described error.
@eps1lon
yes the warning is correct. but it must not cause the described error.
Agreed. However I experienced the same issue that react warnings would cascade into enzyme and cause all sorts of other warnings (unrelated to the Modal). Not sure what enzyme is doing when react warnings are triggered. So be sure to fix the react warnings first so that we can isolate the issue. As it looks right now it might be an enzyme only issue.
finally I checked the props. The list of props is correct.
In summary:
1) I have a mounted Dialog component
2) then, url redirection with react-router => new url
3) redirect to a component with a Dialog with open === true
4) then an error equivalent to the error with unsupported props

<Dialog
hideBackdrop={...}
PaperProps={...}
classes={{
root: ...,
paper: ...
}}
onEntered={...}
fullScreen={...}
open={...}
onExited={...}
TransitionComponent={...}
>...</Dialog>
I think the error is related to the react-router redirection.
- then an error equivalent to the error with unsupported props
That error message should give you a hint what's wrong. Could you add it in case someone else has the same issue?
message edited
Alright, I have found a simple reproduction.
@amensouissi I'm updating your pull request with the failing test case.
How to fix this issue?
@pavanshinde47
https://github.com/mui-org/material-ui/pull/13778
@pavanshinde47
13778
I am sorry, but I am not sure what the solutions is? Is it to update the version to 3.6.1? If so i already did it but still facing the issue. Kindly let me know the exact solution. Thanks.
@pavanshinde47 Rollback to a previous version.
@pavanshinde47 Rollback to a previous version.
previous was 3.2.0, the issue started here so i updated to 3.6.1.
Hi, confused by the last two comments.
Is this fixed on version 3.6.1?