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:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
Fixed in #677.
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.