Skip to content

Commit

Permalink
[fixed] make node.element dynamic getter
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Dec 23, 2015
1 parent bf2e067 commit 338706a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ export function createNode(subject, lastWrapper) {
node = Object.defineProperties({}, {
$$typeof: { value: NODE_TYPE },
nodeType: { value: type },
element: { value: element, enumerable: true },
element: {
enumerable: true,
get() {
if (node.privateInstance)
return node.privateInstance._currentElement

return element
}
},
privateInstance: { value: inst, enumerable: true },
instance: {
enumerable: true,
Expand Down

0 comments on commit 338706a

Please sign in to comment.