Skip to content

Commit

Permalink
Properly detect Lazy views (#906)
Browse files Browse the repository at this point in the history
Since oldVNode is the only result of lazy view and not the lazy node itself, oldVNode.type !== LAZY_NODE check leads to constant lazy view re-rendering.
  • Loading branch information
sergey-shpak authored and jorgebucaran committed Jan 13, 2020
1 parent a04bef7 commit cf6c745
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,8 @@ var getTextVNode = function(node) {

var getVNode = function(newVNode, oldVNode) {
return newVNode.type === LAZY_NODE
? ((!oldVNode ||
(oldVNode.type !== LAZY_NODE ||
propsChanged(oldVNode.lazy, newVNode.lazy))) &&
((oldVNode = getTextVNode(newVNode.lazy.view(newVNode.lazy))).lazy =
? ((!oldVNode || !oldVNode.lazy || propsChanged(oldVNode.lazy, newVNode.lazy))
&& ((oldVNode = getTextVNode(newVNode.lazy.view(newVNode.lazy))).lazy =
newVNode.lazy),
oldVNode)
: newVNode
Expand Down

0 comments on commit cf6c745

Please sign in to comment.