Skip to content

Enhance useReducer example and add section on explicit typing#800

Merged
filiptammergard merged 3 commits into
typescript-cheatsheets:mainfrom
maurer2:main
May 15, 2026
Merged

Enhance useReducer example and add section on explicit typing#800
filiptammergard merged 3 commits into
typescript-cheatsheets:mainfrom
maurer2:main

Conversation

@maurer2
Copy link
Copy Markdown
Contributor

@maurer2 maurer2 commented Feb 14, 2026

Hello,
I noticed that in the useReducer section, the introductory text strongly recommends adding a return type for the reducer, but the code example does not include one. Additionally, I added a section on explicit typing for useReducer for cases where TypeScript can't infer the correct types from the reducer, as mentioned in the React 19 upgrade guide

Cheers

@maurer2 maurer2 changed the title Extend code sample for useReducer and add section on explicit typing Enhance useReducer example and add section on explicit typing Feb 14, 2026
@maurer2 maurer2 marked this pull request as ready for review March 19, 2026 11:47
Copy link
Copy Markdown
Collaborator

@filiptammergard filiptammergard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@filiptammergard filiptammergard merged commit 168469a into typescript-cheatsheets:main May 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants