Skip to content
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

[Dialog] Fix typescript support for custom breakpoints #26330

Closed
2 tasks done
alanszp opened this issue May 16, 2021 · 2 comments · Fixed by #26331
Closed
2 tasks done

[Dialog] Fix typescript support for custom breakpoints #26330

alanszp opened this issue May 16, 2021 · 2 comments · Fixed by #26331
Labels
bug 🐛 Something doesn't work component: dialog This is the name of the generic UI component, not the React module! ready to take Help wanted. Guidance available. There is a high chance the change will be accepted

Comments

@alanszp
Copy link
Contributor

alanszp commented May 16, 2021

Dialog.d.ts typings has hardcoded breakpoints in its definition instead using Breakpoint from createBreakpoints.

  • 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 😯

This makes typescript fail when you add custom breakpoints and want to use it in maxWidth prop.

Warning: Failed prop type: Invalid prop `maxWidth` of value `tablet` supplied to `ForwardRef(Dialog)`, expected one of ["lg","md","sm","xl","xs",false].

Expected Behavior 🤔

To be able to add custom breakpoints in maxWidth

Steps to Reproduce 🕹

https://codesandbox.io/s/happy-volhard-0u9o8?file=/src/Demo.tsx

Context 🔦

Just created a similar fix for Container (#26328), but when I was trying to fix this one in a new PR, I saw that the PropTypes of the Dialog were generated automatically via yarn proptypes.

Tried the change in the Dialog.d.ts and run the command but the PropTypes were not properly generated (with the /* @typescript-to-proptypes-ignore */).

Your Environment 🌎

codeshare :D

@alanszp alanszp added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 16, 2021
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: dialog This is the name of the generic UI component, not the React module! ready to take Help wanted. Guidance available. There is a high chance the change will be accepted and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 16, 2021
@oliviertassinari
Copy link
Member

oliviertassinari commented May 16, 2021

See #26328 as a baseline for the implementation to copy.

@alanszp
Copy link
Contributor Author

alanszp commented May 17, 2021

Already created by @jeferson-sb
#26331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: dialog This is the name of the generic UI component, not the React module! ready to take Help wanted. Guidance available. There is a high chance the change will be accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants