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

fixes errors thrown when React unmounts the contentDOMWrapper #62

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

saranrapjs
Copy link
Member

This PR proposes a fix to #42 within the current architecture (where we create wrapping nodes and React portals for node views).

The inspiration for this approach comes from a previous implementation where we had to do something like what happens on this branch: at the moment that a NodeView's destroy hook is being called, we re-attach the parts of the DOM which React controls in roughly the locations where React expects them for its cleanup phase.

// from the DOM. Here we attempt to reassemble the DOM that React
// expects when cleaning up the portal.
if (componentRef?.contentDOMParent) {
this.dom.appendChild(componentRef?.contentDOMParent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the ?. here shouldn't be necessary.

Copy link
Contributor

@tilgovi tilgovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me. Hacky, but that's the territory.

@smoores-dev
Copy link
Collaborator

@saranrapjs you can resolve the version check issue with yarn version patch --deferred. It should make a new yaml file in the .yarn/versions directory. And I agree with @tilgovi, this looks good!

@smoores-dev smoores-dev merged commit b4dbdeb into main Nov 14, 2023
2 checks passed
@smoores-dev smoores-dev deleted the fix-deletion-error branch November 14, 2023 15:47
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.

None yet

3 participants