react-component / react-component/input-number
不能将类型 SetStateAction<number> 分配给类型 (value: number | null) => void
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 323
- Forks
- 188
- Avg merge
- 20h 3m
- Merged PRs (30d)
- 1
Description
onChange 的改动是否是破坏性改动?
const [val, setVal] = useState(0)
<InputNumber val={val} onChange={setVal} />
造成了大面积编译不过

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 by inspecting the InputNumber onChange type and reproducing the shown useState example with TypeScript. Compare the current callback signature with React's SetStateAction; done when the intended compatibility behavior is established and the issue's breaking-change question is resolved.
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
- 25/100