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

Preventing unnecessary AnimateInOut re-renderings #1989

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nfantone
Copy link

While following the video tutorial on perf optimizations, I encountered a few preventable tree re-renderers coming from within react-beautiful-dnd itself, thanks to wdyr.

  1. On mount, each Draggable on the screen re-sets its state to the same default values in getDerivedStateFromProps.
  2. On drag, each Droppable placeholder forces an AnimateInOut re-render by creating a new children function each time.

image

This PR fixes both.

@atlassian-cla-bot
Copy link

atlassian-cla-bot bot commented Oct 23, 2020

Hooray! All contributors have signed the CLA.

@nfantone nfantone changed the title Preventing unnecessary droppable re-renderings Preventing unnecessary AnimateInOut re-renderings Oct 23, 2020
@nfantone nfantone force-pushed the fix/droppable-rerenders branch from d4243b2 to e1d3559 Compare October 23, 2020 14:54
@nfantone nfantone force-pushed the fix/droppable-rerenders branch from e1d3559 to 9073656 Compare October 23, 2020 15:12
@nfantone
Copy link
Author

nfantone commented Dec 8, 2020

🦗.

@nfantone
Copy link
Author

🦗
🦗.

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

Successfully merging this pull request may close these issues.

1 participant