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.

Indistinguishable properties and attributes

See original GitHub issue

Currently, the patch() function treats every JSX attribute simultaneously as a property and an attribute - it initializes both, which means you have no ability to update them individually.

Blindly treating every JSX attribute as both a property and an attribute means that most updates are unnecessarily being done twice - one of them generating either a meaningless property or a meaningless DOM attribute. The DOM accumulates a lot of garbage this way.

For example, <div innerHTML={content}> will inject literal HTML via the innerHTML property, but will also create a useless innerHTML attribute - or in some cases, such as <input value={value}>, will initialize the value twice, first using the value property, then again using setAttribute('value', ...).

I don’t have a lot of references, but snabbdom for one separates properties from attributes - which seems sort of inevitable, at the VDOM level, if we want to solve this problem?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jorgebucarancommented, Nov 26, 2017

Well, in that case I guess I’ll help myself with your fork and try to come up with a solution myself! 💪😄

0reactions
mindplay-dkcommented, Dec 19, 2017

Bingo, the tests are passing 😄

I’ve opened a PR which I think is ready for review now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Just Noticeable Differences in Visual Attributes
We explore the problem of predicting “just noticeable differences” in a visual attribute. While some pairs of images have a clear ordering for...
Read more >
Benedict de Spinoza: Metaphysics
Leibniz argued that whereby it might be impossible for two substances to have all of their attributes in common (because then they would...
Read more >
Attribute reduction algorithm based on indistinguishable degree
attribute reduction based on discernibility matrix, an indistinguishable degree definition and the corresponding properties are introduced.
Read more >
The concept 'indistinguishable'1 Simon Saunders
Abstract. The concept of indistinguishable particles in quantum theory is fundamental to questions of ontology. All ordinary matter is made of electrons, ...
Read more >
Contextuality and Indistinguishability - MDPI
Our proposed theory of indistinguishable properties would ... beyond their attributes, but this is to push metaphysics too far, see [41].
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