Skip to content

fix(createReducer): return action from Dispatch to match Redux types#2712

Open
mmustafasenoglu wants to merge 1 commit into
streamich:masterfrom
mmustafasenoglu:fix/all-three-issues
Open

fix(createReducer): return action from Dispatch to match Redux types#2712
mmustafasenoglu wants to merge 1 commit into
streamich:masterfrom
mmustafasenoglu:fix/all-three-issues

Conversation

@mmustafasenoglu

Copy link
Copy Markdown

Summary

The Dispatch type in createReducer was returning void, which caused TypeScript errors when using the hook with redux-thunk or other middleware that expect dispatch to return the action.

Fixes #856

Changes

Changed Dispatch<Action> return type from void to Action to align with Redux's Dispatch typing.

- type Dispatch<Action> = (action: Action) => void;
+ type Dispatch<Action> = (action: Action) => Action;

Testing

Verified that the type change matches Redux's dispatch signature and resolves the TypeScript compilation errors reported in the issue.

The Dispatch type was returning void, which caused TypeScript errors
when using createReducer with redux-thunk or other middleware that
expect the dispatch to return the action.

Fixes streamich#856
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.

createReducer not working with Typescript (type def errors showing up)

1 participant