User has no way of knowing that a required prop needs an example value
[#3574668]
This MR
- adds prefilled example values when a prop is marked required
- adds a message in the UI if an example value is empty while it is required
- "A required prop must have an example value."
- prefills default example when changing type on a required prop
- added unit tests for required prop example validation in Props.test.tsx
Things considered:
- I thought about not updating the store if a user marked a prop required with no example value, but I think having the UI not reflect the redux store would make things confusing, because the UI would show it marked required, but the store would not reflect that.
- An internal component has the "Add to components" button that will prevent the user from creating a required prop with an empty example but exposed components don't have an "action button" to check for validations, it just gets auto-saved every 10 seconds
Edited by Harumi Jang