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

Refactor useDndMonitor() to dispatch events synchronously #750

Merged
merged 1 commit into from
May 20, 2022

Conversation

clauderic
Copy link
Owner

The useDndMonitor() hook has been refactored to be synchronously invoked at the same time as the events dispatched by <DndContext> (such as onDragStart, onDragOver, onDragEnd).

The new refactor uses the subscribe/notify pattern and no longer causes re-renders in consuming components of useDndMonitor() when events are dispatched.

@changeset-bot
Copy link

changeset-bot bot commented May 19, 2022

🦋 Changeset detected

Latest commit: bf30718

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@dnd-kit/core Minor
@dnd-kit/modifiers Major
@dnd-kit/sortable Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@clauderic clauderic self-assigned this May 19, 2022
@clauderic clauderic force-pushed the dnd-monitor-refactor branch 3 times, most recently from f0e32fa to 3c58d30 Compare May 20, 2022 00:59
@clauderic clauderic merged commit 01f0a2d into master May 20, 2022
@clauderic clauderic deleted the dnd-monitor-refactor branch May 20, 2022 01:37
@github-actions github-actions bot mentioned this pull request May 20, 2022
@clauderic clauderic added the enhancement New feature or request label May 20, 2022
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 this pull request may close these issues.

useDndMonitor() hook always re-renders the component instead of firing callbacks
1 participant