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

Accept 0 as rotation value #336

Open
franz-josef-kaiser opened this issue Dec 3, 2021 · 0 comments
Open

Accept 0 as rotation value #336

franz-josef-kaiser opened this issue Dec 3, 2021 · 0 comments

Comments

@franz-josef-kaiser
Copy link

franz-josef-kaiser commented Dec 3, 2021

Is your feature request related to a problem? Please describe.
I was hunting a console error for the rotation custom property validator failing for a good hour, just to find out, that the accepted value is not of a single type, but of two.

  • Previously: String
  • Now: Number
  • De factor: {Number | null}).

Related

Describe the solution you'd like
It would be more obvious to accept 0 as proper and valid value than suggesting to use null instead.

The docs mention that nowhere and even if: No one would imagine

Invalid prop: custom validator check failed for prop "rotation"

being a problem with the value, but the type.

Describe alternatives you've considered
Just add 0 as valid value here.

Well, you could as well extend the validator to output the actual value and show the valid and accepted values in comparison. This would improve the developing experience by a good bit for all cases, reduce support requests and SO threads.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants