Issue with Typescript and `withMobileDialog`
See original GitHub issueTrying to use Dialog with the withMobileDialog HOC in Typescript results in an ugly Typescript error
- This is not a v0.x issue.
- I have searched the issues of this repository and believe that this is not a duplicate.
Here’s the codesandbox: https://codesandbox.io/s/j403mnwyov
…and in the code sandbox (along with Atom, locally), I get this error:

The codesandbox is fairly bare-bones, so I don’t think I’m doing anything wrong (though I’m still pretty new to Typescript, so who knows?)
Any help is appreciated. Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Issue with Typescript and withMobileDialog #15448 - GitHub
Trying to use Dialog with the withMobileDialog HOC in Typescript results in an ugly Typescript error This is not a v0.x issue.
Read more >How to use Material-UI withMobileDialog HOC in TypeScript?
I'm having trouble using withMobileDialog in TypeScript. Here's my code, based on the code sample in the docs. import withMobileDialog, { ...
Read more >Breaking changes in v5, part two: core components - Material UI
This is a reference guide to all of the breaking changes introduced in Material v5, and how to handle them when migrating from...
Read more >Documentation - TypeScript 3.9
What About the awaited Type? If you've been following our issue tracker and design meeting notes, you might be aware of some work...
Read more >How to use Material-UI withMobileDialog HOC in TypeScript?
Coding example for the question How to use Material-UI withMobileDialog HOC in TypeScript?-Reactjs.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Okay, so in my defense here, what I illustrated is a “bug”, given that I’m using MUI 3.9.3, and @eps1lon, the example you provided (thanks for that!) is from the next branch, which is not production-ready yet (though it looks like it might be released in May 2019, which would be nice).
Also, FWIW,
withMobileDialogworks just fine in JS, just not TS in 3.9.3@martisj thanks for this. The problem was that I was using the prior version of Material UI, but everything works great in the latest version.