Skip to content

Store parent node in render #802 #820

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

roryc89
Copy link

@roryc89 roryc89 commented Oct 10, 2023

I believe this may fix #802, #766 and #657. I have tested this on a similar problem I had with higher order components that had render branches that only rendered a single child component with no wrapping elements.

It seemed to have buggy behaviour when substInParent was passed Nothing for the parent node. To fix this I added the last found parent node to the RenderState

@garyb
Copy link
Member

garyb commented Oct 10, 2023

I am very interested in this! I don't have time to check it out right now, but will as soon as I can. I've periodically worked on this without much luck, but a lot of that time was spent trying to isolate exactly what was happening since I had no concrete hypothesis for what was causing the issue.

@garyb
Copy link
Member

garyb commented Oct 10, 2023

Ah thanks, that wasn't anything to do with you, it was unhappily formatted in main.

@roryc89
Copy link
Author

roryc89 commented Oct 10, 2023

I see that removeChild just removes the node from the DOM. I don't know if my changes will break this as RenderStates with a node no longer attached to the DOM may still have the new node inserted from substInParent.

@flip111
Copy link

flip111 commented Dec 19, 2023

I was having a bug where a component with just a child component was causing new child component placed underneath each other (old child was not removed). I tried this patch and it's still problematic, instead of the child component placed directly underneath it's now placed before the end of the body tag

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.

Child component gets rendered outside of parent, being moved to bottom of HTML body
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy