Closed
Description
Hi,
I'm trying to provide typings for my actions inside a connected component.
interface IDispatchProps {
setName: typeof setName // where setName is an imported action
}
Given that the action is defined as:
export const setName = actionCreator<string>('SET_NAME');
The idea is to use those typings when defining mapDispatchToProps
:
const mapDispatchToProps = (dispatch): IDispatchProps => ({
setName: (name:string) =>dispatch(setName(name))
})
However I get an error about the typings being incompatible. Is there a way to get the type of that action?
Metadata
Metadata
Assignees
Labels
No labels