Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Unmount react component when WpBlock is disconnected #47

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

DAreRodz
Copy link
Collaborator

@DAreRodz DAreRodz commented Aug 3, 2022

Fixes #42.

The solution is straightforward. Inside the disconnectCallback() defined in WpBlock, we run unmountComponentAtNode(this) to safely unmount the React tree within the WpBlock instance.

Here is a video where I show how it works: #42 (comment)

@DAreRodz DAreRodz self-assigned this Aug 3, 2022
@DAreRodz DAreRodz added the bug Something isn't working label Aug 3, 2022
@DAreRodz
Copy link
Collaborator Author

DAreRodz commented Aug 5, 2022

I don't think this really needs a review, hehe, it's already tested and works fine. I'll just merge it. 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unmount interactive blocks before removing them from the DOM
1 participant