New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I use dispatch in a connectDropTarget component? #393
Comments
finally, i found could be doing like this:
|
No, What you want is to put const dropTodoTarget = {
drop(props,monitor,component) {
var todo = monitor.getItem();
if (todo.board_id != props.board_id) {
props.dispatch(actions.completeTodo(todo.board_id,this.props.board_id))
}
return {};
}
};
// ...
export default flow(
DropTarget(ItemTypes.TODO, dropTodoTarget, collect),
connect()
)(TodoList); |
Isn't it suppose to come before? |
Issue solved here. Trying to dispatch function from drop. DropTarget should go before connect react-dnd/react-dnd#393
What is |
when I use react-DND , found a problem.
question, I wanna to use dispatch in a connectDropTarget component.
when I wrote like this.
Uncaught TypeError: component.localHandleMove is not a function
I wanna how could I use dispatch in a component?
thanks
The text was updated successfully, but these errors were encountered: