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

Chore: fixed console warnings of prop types #351

Closed
wants to merge 1 commit into from

Conversation

stackoverfloweth
Copy link
Contributor

from a typescript perspective modalValue: T | null | undefined === modalValue?: T | null
vue's defineProp perspective must be different, because the former results in a bunch of console warnings

Screen Shot 2022-08-26 at 7 51 41 AM

@netlify
Copy link

netlify bot commented Aug 26, 2022

Deploy Preview for prefect-design ready!

Name Link
🔨 Latest commit 3bd54f7
🔍 Latest deploy log https://app.netlify.com/sites/prefect-design/deploys/6308c508bfeaac00086cdeee
😎 Deploy Preview https://deploy-preview-351--prefect-design.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@pleek91
Copy link
Collaborator

pleek91 commented Aug 26, 2022

I actually don't think we should change this. The two are not equal even in typescripts eyes. { foo?: string | null } is different than {foo: string | null | undefined} in the fact that a non optional prop must be passed. TS Playground example. Changing this means our component types will not require the modalValue be passed and our components don't work without that prop. Which I believe would cause errors at runtime. Which is a poor developer experience.

Also, I believe a fix for this will be coming in the not to distant future.
Issue
PR

For now I'd rather deal with the warnings OR at an implementation level coaless undefined to null

@pleek91 pleek91 deleted the undefined-prop-warnings branch January 22, 2024 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants