question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected appendChild of text nodes during render with merge

See original GitHub issue

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 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bardtcommented, Jul 1, 2016

@developit I can still see several createElement and appendChild calls. Should I provide an example?

0reactions
developitcommented, Jul 24, 2016

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found