Comments (3)
something like this?
diff --git a/src/components/render.js b/src/components/render.js
index 265b265..8bedce1 100755
--- a/src/components/render.js
+++ b/src/components/render.js
@@ -212,6 +212,7 @@ function isDifferentNode (node1, node2) {
(typeof node1.nodeType === 'number' && node1.nodeType !== node2.nodeType) ||
(typeof node1.tagName === 'string' && node1.tagName !== node2.tagName) ||
(typeof node1.id === 'string' && node1.id !== node2.id) ||
+ (node1.getAttribute?.call(node1, 'key') !== node2.getAttribute?.call(node2, 'key')) ||
(typeof node1.src === 'string' && node1.src !== node2.src)
);
}
from reef.
@duhdugg yea, though I don't think you need to the optional chaining operator/call()
method on that one. I think you can just test it outright since strings and such don't generally make it to the test. I could be wrong.
from reef.
I'm having a little trouble following everything that might be passed to it, but I think you're right. The biggest user of this function is the diff
function, which is used by render
. There is a possibility that the wrong elem
argument is provided to render, but this already causes an uncaught exception earlier in the diff
function as it tries to access the childNodes
property on a null
value.
I'll submit a PR with no optional chaining.
from reef.
Related Issues (20)
- Input fields not updated to reflect data changes HOT 3
- Issues with listeners and multiple on events HOT 1
- "Ready" event never fires HOT 1
- Binding input value changes to data HOT 1
- Objects with functions lost when copied to props HOT 1
- "on" attributes not being properly converted to event listeners
- Obj events = {} storing duplicate event listiners causing duplicate calls HOT 3
- Add component.destroy() method HOT 3
- Add Source Map Files HOT 1
- Nested Components + events? HOT 1
- Use domdiff? HOT 3
- Events for component HOT 5
- Using Map or Set as store HOT 2
- Is there a way to force a component to "rerender" without adding content? HOT 3
- Working with Events Questions HOT 2
- Lifecycle Events - reef:render is fired on all components in the document HOT 2
- Can I use Reef to generate the HTML for a given route? HOT 1
- Updating Multiple Properties at Once HOT 10
- Lack of event support in component HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reef.