Unexpected appendChild of text nodes during render with merge
See original GitHub issueI’m currently working on a Preact app with server rendering. So, I use render()
with the third argument root.lastChild
. As I render the same data on client and server, I expect this render to do nothing to real DOM nodes, except attaching events. But I see appendChild
in the call tree. As a result, first rendering on client takes longer than expected (and longer than alternative libraries).
Naive debugging lead to a conclusion that this happens to text nodes. Looks like text node is not considered an existing child during diffing.
Before I go deeper into debugging, I’d like to know if this is an expected behavior and what are reasons for that.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Unexpected appendChild of text nodes during render with merge ...
I'm currently working on a Preact app with server rendering. So, I use render() with the third argument root.lastChild. As I render the...
Read more >Text nodes on JavaScript sometimes don't merge
When merging 3 text nodes in 3 different paragraphs, the first two ps don't merge in one of the text nodes. It should...
Read more >Building Components with D3 Data Join - Scott Logic Blog
This post quickly introduces data join before moving on to some of the edge cases we've run into when building components on top...
Read more >Everything you need to know about ng-template, ng-content ...
All a sudden, something caught my attention: Final rendered DOM in AngularWhile inspecting the DOM I saw the ngcontent being applied on ......
Read more >Composition - Material UI - MUI
This section covers caveats when using a custom component as children or for the component prop. Some of the components need access to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@developit I can still see several
createElement
andappendChild
calls. Should I provide an example?Closing since I’ve done as much testing as I can find time for and can’t see new textnodes being created. Please re-open if there is still an issue in
5.6.0
!