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
component is null in beginDrag? #530
Comments
Turns out the issue is DnD doesn't like stateless components :( I changed
to
and component is now correctly passed to beginDrag. It's worth mentioning the stateless component otherwise worked as expected so was quite confused why component is null in beginDrag. It might be worth updating the beginDrag documentation to state DnD doesn't work with stateless components (assuming this can't be fixed). |
Oof, just waisted a few cycles on this too (except with the |
Ran into this just now also -- suspect the issue is stateless components have no public instance. React-dnd may need to tweak how they use refs, as |
This just happened to me when upgrading Workaround: switched the order of DragSoruce and connect. :-/ |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The documentation says component is passed to beginDrag (3rd parameter) however it seems to be null when called? Not sure if it's something I'm doing wrong. If it helps my component is both a drag source and drag target.
What I am wanting to do is get the height of my component inside beginDrag, this is not something I can derive from the props passed so I need access to the component.
The text was updated successfully, but these errors were encountered: