Skip to content

Commit

Permalink
Merge pull request #1 from paulovitin/mutation-boot
Browse files Browse the repository at this point in the history
Boot components in DOMContentLoaded event
  • Loading branch information
rstacruz authored Feb 17, 2019
2 parents abc7803 + 5780b06 commit 25e0124
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/strategies/mutation_observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export function defineElement(
})

observers[name] = true

window.addEventListener('DOMContentLoaded', () => {
const nodes = document.getElementsByTagName(name);
[...nodes].forEach(node => checkForMount(node, name, events))
});
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "remount",
"description": "Mount React components to the DOM using custom elements",
"version": "0.9.4",
"version": "0.9.5",
"author": "Rico Sta. Cruz <[email protected]>",
"bugs": {
"url": "https://github.com/rstacruz/remount/issues"
Expand Down

0 comments on commit 25e0124

Please sign in to comment.