In the documentation, the value prop is marked as a required prop. But when users forget to provide this prop, it does not raise any exceptions or show any warnings. When generating barcode for my app, I used the text prop instead of value prop and the barcode is showing fine. The value of the barcode when scanning is undefined. I was so dumb that I did not check it before releasing the app, which caused my users could not use the barcode.
Summary:
This PR is to throw an error if the value prop is not a non-empty string. As value prop is a required prop, it should raise an exception if the value is blank.
Context:
In the documentation, the
value
prop is marked as arequired
prop. But when users forget to provide this prop, it does not raise any exceptions or show any warnings. When generating barcode for my app, I used thetext
prop instead ofvalue
prop and the barcode is showing fine. The value of the barcode when scanning isundefined
. I was so dumb that I did not check it before releasing the app, which caused my users could not use the barcode.Summary:
This PR is to throw an error if the value prop is not a non-empty string. As value prop is a
required
prop, it should raise an exception if the value is blank.Screenshots
When no value, no onError