TS + ReduxDevtools + React…Invalid number of arguments, expected 2 for actions

i have action:

updateContent: (state: Pick<projectState, 'content'>, action: PayloadAction<Pick<projectState, 'content'>>) => {

and I try to dispatch my action

dispatch(updateContent(data))

Butenter image description here I have Invalid number of arguments, expected 2 for actions

TS thinking that updateContent: (state: Pick<projectState, 'content'>, action: PayloadAction<Pick<projectState, 'content'>>) should have 2 arguments…

  • What “version” of dispatch are you using? Have you setup the store to export a typed dispatch function? Can you edit to provide a more complete minimal reproducible example of the relevant code you are working with?

    – 

Leave a Comment