He usado { useHistory } from react-router-dom en el componente de reacción. Y al hacer clic en el botón, intento pasar la instancia del historial como carga útil a la saga a través de action.ts
componente.tsx
import React from 'react'; import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; import {recievingHistoryAsPayload } from 'store/actions'; const Component: React.FC = () => { const history = useHistory(); const dispatch = useDispatch(); const sendHistoryObj = () => { dispatch(recievingHistoryAsPayload({ payload: history })); }; return ( <Button onClick={sendHistoryObj} /> ); }; export default Component;acción.ts
export const recievingHistoryAsPayload = createAction( Types.RECEIVING_HISTORY_AS_PAYLOAD, (data) => data );saga.ts
export function* recievingHistoryAsPayloadSaga(action: any): Generator { yield call(action?.payload?.push, '/'); } en saga.ts, para la carga útil de la acción, eslint está lanzando una guerra con el mensaje Argument 'action' should be typed with a non-any type.
Qué tipo debe definirse para la acción en saga.ts