fix: add number type in value
Closes https://github.com/adobe/react-spectrum/issues/6628
✅ Pull Request Checklist:
- [ ] Included link to corresponding React Spectrum GitHub Issue.
- [ ] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
- [ ] Filled out test instructions.
- [ ] Updated documentation (if it already exists for this component).
- [ ] Looked at the Accessibility Practices for this feature - Aria Practices
📝 Test Instructions:
🧢 Your Project:
@snowystinger @yihuiliao thx! Corrections are complete.
Unfortunately I think this is a breaking change. People would need to update their types in a lot of places, as shown in the examples here.
Also, input values are always strings in the DOM (see MDN), and even in React's docs. I'm not sure why @types/react allows numbers. The value will be coerced to a string in the DOM anyway, so the value in onChange will always be a string no matter what. We could allow that but IMO it's kinda weird so sticking with strings everywhere is probably the clearest about what's actually happening.