Skip to content

Commit

Permalink
build: move rootNode logic out of vanilla (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Feb 7, 2020
1 parent 8698458 commit 4c960c2
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/vanilla/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ function forEach (list, fn) {

function microlink (selector, opts, rootNode) {
return forEach(getDOMSelector(selector), function (el) {
if (!rootNode) {
rootNode = document.createElement('div')
rootNode.className = 'microlink_vanilla_dom'
el.parentNode.insertBefore(rootNode, el)
}

ReactDOM.render(
React.createElement(
Microlink,
Expand All @@ -45,10 +39,8 @@ function microlink (selector, opts, rootNode) {
parseObject(el.dataset)
)
),
rootNode
rootNode || el
)

el.remove()
})
}

Expand Down

0 comments on commit 4c960c2

Please sign in to comment.