Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript: Types of parameters 'action' and 'action' are incompatible #9

Open
dotai2012 opened this issue Sep 10, 2020 · 0 comments
Open

Comments

@dotai2012
Copy link

dotai2012 commented Sep 10, 2020

This happens when an action that has some more properties than 'type'

Possible fix:

export function combineReducers(
    produce: IProduce,
    reducers: ReducersMapObject
): Reducer;

To:

export function combineReducers<S>(
    produce: IProduce,
    reducers: ReducersMapObject<S, any>
): Reducer<CombinedState<S>>
export function combineReducers<S, A extends Action = AnyAction>(
    produce: IProduce,
    reducers: ReducersMapObject<S, A>
): Reducer<CombinedState<S>, A>
export function combineReducers<M extends ReducersMapObject<any, any>>(
    produce: IProduce,
    reducers: M
): Reducer<
CombinedState<StateFromReducersMapObject<M>>,
ActionFromReducersMapObject<M>>
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

No branches or pull requests

1 participant