Event number validation fails for zero which is inconistent with props #12523
-
Version3.5.13 Reproduction linkSteps to reproduce
What is expected?Numeric events should succeed for zero. What is actually happening?Event validation fails and a warning is displayed. I am aware you can get around this by setting the event to "required: false" but means any falsey value can be emitted without an warning. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Please refer to the runtime syntax of |
Beta Was this translation helpful? Give feedback.
Your use case is half correct. When passing in a validate function (
zeroEvent: Number
), its return value will be used as the validation condition, and any falsy value will be considered as validation failure. You happened to pass in 0.