Skip to content

Commit

Permalink
implent refs to have access to the node on the view
Browse files Browse the repository at this point in the history
  • Loading branch information
lopez-alex committed Mar 6, 2018
1 parent 0be245e commit 4ccbb31
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/jsx-render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ function dom(tag, attrs, ...children) {

Object.assign(element, attrs)

if (attrs instanceof Object && attrs.ref && typeof attrs.ref === 'function') {
attrs.ref(element)
}

return element
}

Expand Down

0 comments on commit 4ccbb31

Please sign in to comment.