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.

Reusing nodes should not retain the class list

See original GitHub issue

(Originally created in preact-compat as https://github.com/developit/preact-compat/issues/365. See that issue for link to possible culprit.)

In 8.1.0 with preact-compat@3.15.0, it appears that render reuses the first child of the target node and its class list? But only when the first element of the react component tree does not have a class list?

Simply applying className="" to the first element of the top-level React component solves the error, but should probably not be necessary?

This can cause some weird styling due to unexpected CSS inheritance.

Example: https://codepen.io/bionicbrian/pen/GmpzVP

I think this may be related to this preact issue: https://github.com/developit/preact/issues/544 ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
developitcommented, Jun 27, 2017

Fixed in #677.

0reactions
developitcommented, Apr 29, 2017

yup. right now preact does not remove DOM attributes it does’t have replacement values for when performing an initial render. If anyone wants to PR adding the diff back in that’d be awesome, otherwise I’ll try to get to that as soon as I can.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to reuse code for a list (or how to deal with 2 different ...
The logical answer is yes because I do not find any reason in the code as to why they wouldn't. But I can't...
Read more >
Object Reuse - Java Performance Tuning [Book] - O'Reilly
Most container objects (e.g., Vector s, Hashtable s) can be reused rather than created and thrown away. Of course, while you are not...
Read more >
Linked list node implementation with maximum code reuse
The answer has to be no. It should have exactly the same methods as the BaseClass (I mean, the name, parameter types and...
Read more >
How To Save & Reuse YOUR Effects In Davinci Resolve ...
Do you want to learn how to save your davinci resolve Fusion creations so you can use them over and over again to...
Read more >
Chapter 22 Custom Generic Data Structures—Solutions
Rewrite the List class so that it does not use a lastNode. Thus, any operations on the tail of a list must begin...
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