DefinitelyTyped / DefinitelyTyped/DefinitelyTyped
mapDispatchToProps wrongfully allows null
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 51.4k
- Forks
- 30.4k
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 108
Description
Hello,
I'm sorry if it's a known issue or a duplicate or something that is correct, I checked but couldn't find anyone mention that.
When I omit the mapDispatchToProps the typing is correct


But when I set the mapDispatchToProps explicitly to null


it breaks the omitted props (it's Omit<Props, never> instead of Omit<Props, 'storeProp'>)
Also if that is not an issue but a feature, could you explain why it works this way?
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
Locate the mapDispatchToProps type definitions in this DefinitelyTyped repository and reproduce the difference between omitting the argument and passing null. Check how the resulting omitted props are inferred, then add coverage for both cases. Done means null no longer produces Omit<Props, never> when the omitted-props behavior should be preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100