Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type DispatchProps = {
- selectRow: (index: number) => void,
- loadData: (fetchArgs: FetchArgs) => void,
- };
- // This works
- const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({
- selectRow: (selectedRowIndex: number) => dispatch(actions.selectRow(selectedRowIndex)),
- loadData: (fetchArgs: FetchArgs) => dispatch(actions.loadData(fetchArgs)),
- });
- // This doesn't work
- const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => bindActionCreators({
- selectRow: actions.selectRow,
- loadData: actions.loadData,
- }, dispatch);
- SelectRowAction [1] is incompatible with undefined [2] in the return value of property `selectRow`.
Add Comment
Please, Sign In to add comment