hooks
hooks copied to clipboard
feat(useControllableValue): improve types using key of props
🤔 This is a ...
- [ ] New feature
- [ ] Bug fix
- [ ] Site / documentation update
- [ ] Demo update
- [x] TypeScript definition update
- [ ] Bundle size optimization
- [ ] Performance optimization
- [ ] Enhancement feature
- [ ] Internationalization
- [ ] Refactoring
- [ ] Code style optimization
- [ ] Test Case
- [ ] Branch merge
- [ ] Other (about what?)
🔗 Related issue link
💡 Background and solution
Restrict the input of defaultValuePropName
, valuePropName
and trigger
to be the key
in props
📝 Changelog
Language | Changelog |
---|---|
🇺🇸 English | feat(useControllableValue): improve types using key of props |
🇨🇳 Chinese | feat(useControllableValue): 使用 props 的 key 改进类型 |
☑️ Self Check before Merge
⚠️ Please check all items below before review. ⚠️
- [x] Doc is updated/provided or not needed
- [x] Demo is updated/provided or not needed
- [x] TypeScript definition is updated/provided or not needed
- [x] Changelog is provided or not needed
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.
:white_check_mark: liuyib
:x: u3u
You have signed the CLA already but the status is still pending? Let us recheck it.
我这边测试是没问题的,另外 keyof P 不也是 string 吗?

类型推断指定了第一个泛型被中断了 必须手动指定第二个泛型的类型 但是不指定第一个泛型又不能确定 value
的类型 不知道还有没有更好的办法 如果能直接推断出 valuePropName
对应的类型就好了