Closed
Description
Is there a solution for mapDispatchToProps shorthand syntax?
interface IProps {
action: () => void;
}
const MyComponent = ({ action }: IProps): JSX.Element => (
<div onClick={action}>my component</div>
);
const action = actionCreator<null>('SOME_ACTION'); // bound to dispatch
connect(null, { action })(MyComponent);
I'm getting this error:
Type 'ActionCreator<void>' is not assignable to type '() => void'. TS2769
Is there a way to fix it without changing prop types of MyComponent?
Metadata
Metadata
Assignees
Labels
No labels