react-component / react-component/select

Typescript definition problem in SelectProps.

Open
#446 0 comments 2 reactions 0 assignees View on GitHub

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/245b3b18a8815abc419ab71f9d4ad7c407f0b486/src/generate.tsx#L149-L152

When allowClear was setted in a Select and user clicked Reset Button, Event onchange will be triggered. The typescript definition is wrong. Two parameters are undefined. It should be as below.

onChange?: (value?: T, option?: React.ReactElement<any> | React.ReactElement<any>[]) => void;

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked lines in src/generate.tsx, focusing on the SelectProps onChange definition and the allowClear reset behavior. Update the type so both callback parameters are optional and accept the documented value and option forms; done means the definition matches the reported runtime arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.