Skip to content
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

Memoize attributes returned from useDraggable unless they change #67

Closed
Pustelto opened this issue Jan 21, 2021 · 1 comment · Fixed by #68
Closed

Memoize attributes returned from useDraggable unless they change #67

Pustelto opened this issue Jan 21, 2021 · 1 comment · Fixed by #68
Labels
enhancement New feature or request

Comments

@Pustelto
Copy link
Contributor

Hi @clauderic, thanks for great DnD Library.

I'm trying to create sortable nested tree with it. I'm almost done, but since we have quite a lot of items in the tree and so far I couldn't found virtualization library that would support nested structures. So I'm trying to get as much perf as possible through other means (mainly useMemo hooks and React.memo). However I have noticed that attributes object returned from useDraggable is always a new object, even when the data don't change. It would be greate to memoize this in order to make use of memoization on the items.

Sorry if the description is a little short. I may have a look into this and create PR if necessary.

@clauderic
Copy link
Owner

Should be a fairly straightforward change, feel free to submit a PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants