react-component / react-component/select
onSelect和onDeselect什么时候参数会是option对象
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 938
- Forks
- 482
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 2
Description
看到 https://github.com/react-component/select/blob/master/src/Select.tsx#L112-L113 的参数类型在近期修改成了RawValueType | LabelInValueType,我们使用过程中有遇到tsc检查出来的类型不兼容问题
从文档来看,似乎onSelect和onDeselect的参数只能是value而不会是option对象:

想了解一下,如果这个类型的更新是正确的,那么什么情况下value参数的值会是LabelInValueType类型,便于用户做好相应的逻辑处理
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/Select.tsx around lines 112-113 and compare the callback parameter types with the documented onSelect and onDeselect behavior. Check the relevant type definitions and existing tests or examples to identify when LabelInValueType is expected; done means the typing and documentation agree and the reported tsc incompatibility is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100