Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

added node as return value in useDragHook#210

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mafin1799 wants to merge3 commits intobrimdata:main
base:main
Choose a base branch
Loading
frommafin1799:main

Conversation

mafin1799
Copy link

in the useDragHook hook, is it possible to somehow return not the id but the entire node?
solution to issues #209

@jameskerr
Copy link
Contributor

The reason I just have the id being returned is because this little bit of advice given here:

https://react-dnd.github.io/react-dnd/docs/api/use-drag#specification-object-members

I'm not sure what the implications are by returning the node instead of the id.

Can you explain what you need to know about the node when you're dragging between trees?

@mafin1799
Copy link
Author

dragging between trees in my implementation is checked on the server

to do this, I pass the id and alias of the tree

like

currentTree: device
targetTree: user
objectId: [678, 789, 456]
dropId: [555]

Something like that

Ideally, I need to understand which tree I'm dragging from.

the dragging itself happens to me so that when I hover the dragged element over the node, a request is sent to the server

he checks whether it is possible to drop into this node
, if so, and drop it, then an answer comes that updates the slice of this tree

@jameskerr
Copy link
Contributor

So you need to know the id of the tree and the id of the node? Is that all the data you need?

@jameskerrjameskerr added the documentationImprovements or additions to documentation labelFeb 7, 2024
@mafin1799
Copy link
Author

Yes, it may be worth entering the treeName parameter in the initialization of the Tree component. Because it can be expensive to drive all year and I can see how to implement it and propose a new solution

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

documentationImprovements or additions to documentation

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@mafin1799@jameskerr

[8]ページ先頭

©2009-2025 Movatter.jp