Hi Mustafa, thanks for your response.
Pass a payload in dispatch should not be complicated, we can pass the payload in this way:
const add = React.useCallback((payload) => {
dispatch({ type: ActionTypes.ADD, payload })
}, [dispatch])
Then in use:
add(something)