You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/modules/user.ts|31 col 3 error| 2322[QF available]: Type '{ loading: boolean; foo: string; name?: string | undefined; escritorio?: Escritorio | undefined; claims?: Claim[] | undefined; }' is not assignable to type 'State'. Object literal may only specify known properties, and 'foo' does not exist in type 'State'.
The text was updated successfully, but these errors were encountered:
I can reproduce but I have no idea why it's failing to type properly. I'm not a huge TypeScript user myself unfortunately.
// This is the signature of the `on` function. 2nd argument is a Handler<S, P, M>on<Arg1,P,M={}>(actionCreator: ActionCreatorOrString1<Arg1,P,M>,handler: Handler<S,P,M>): Reducer<S>// This is the type for a Handler, a function that must return a `S`,// where `S` is the `State` during `createReducer`typeHandler<S,P,M={}>=(state: S,payload: P,meta?: M)=>SexportfunctioncreateReducer<S>(handlers: Handlers<S>|OnOff<S>,defaultState?: S): Reducer<S>;
Hi there, first issue here.
These days using redux-act, I found that the handler of
reducer.on
isn't usingstate
type received increateReducer
.Example:
foo: 'bar'
isn't in my interface, and don't throw an error in my typings.It only works when I explict use
State
interface as result of my handler function.Example:
Only this way I got the expected behaviour:
The text was updated successfully, but these errors were encountered: