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
Property 'payload' is missing in type 'AnyAction' #2
Labels
bug
Something isn't working
Comments
huan
changed the title
May 26, 2020
Duck
class is not compatible with DeepReadonly
API
Interface is not compatible with PayloadAction
huan
changed the title
Property 'payload' is missing in type 'AnyAction'
May 30, 2020
API
Interface is not compatible with PayloadAction
import { Reducer } from 'redux'
const count: Reducer<number> = (state: number) => {
return state
}
void count The above code will yield the following error message: error TS2322: Type '(state: number) => number' is not assignable to type 'Reducer<number, AnyAction>'.
Types of parameters 'state' and 'state' are incompatible.
Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
3 const count: Reducer<number> = (state: number) => { It turns out that we are declaring a function that can accept the |
huan
added a commit
that referenced
this issue
May 30, 2020
huan
added a commit
that referenced
this issue
May 30, 2020
huan
added a commit
that referenced
this issue
May 30, 2020
huan
added a commit
to wechaty/ha
that referenced
this issue
Jun 1, 2020
huan
added a commit
to wechaty/ha
that referenced
this issue
Jun 1, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimum reproducible code snip:
The error message of
r
is:However,
To be fixed.
Related Issues
Super-type of T is something like <U extends T>
Regression: 2.4.1 Generic type mismatch microsoft/TypeScript#16985 (comment)The text was updated successfully, but these errors were encountered: