i have action:
updateContent: (state: Pick<projectState, 'content'>, action: PayloadAction<Pick<projectState, 'content'>>) => {
and I try to dispatch my action
dispatch(updateContent(data))
But 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?