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
Thanks for the report! I'll investigate if I can improve the inference here - in the meantime a workaround would be to annotate the action type anyway:
after some investigation, I'm not sure I'll be able to resolve this in a satisfactory manner - inference is a finnicky thing, and getting something that pleases this scenario appears to break others. It appears the reducers's constraint of Record<string, CaseReducer<State, PayloadAction<any>> is causing undoableReducer to infer the action type as PayloadAction<any>.
If I have any brainwaves I'll definitely come back to this, but hopefully in the meantime one of the workarounds above will be enough for your use case.
Using your example I tried to add a reducer with no parameters, as example
setToSeven
When I now try to call the function via dispatch I always get:
TS2554: Expected 1 arguments, but got 0
It does work correctly if I pass any object, null or undefined. But it does not feel clean.
counterSlice.ts
HistoryButtons.tsx
The text was updated successfully, but these errors were encountered: