react-web-component
Advanced tools
Comparing version
{ | ||
"name": "react-web-component", | ||
"version": "1.0.4-alpha", | ||
"version": "1.0.5-alpha", | ||
"description": "Create Web Components with React", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -13,3 +13,3 @@ const ReactDOM = require('react-dom'); | ||
let appInstance; | ||
var appInstance; | ||
@@ -24,5 +24,5 @@ const lifeCycleHooks = { | ||
function callConstructorHook(proto) { | ||
function callConstructorHook(webComponentInstance) { | ||
if (appInstance['webComponentConstructed']) { | ||
appInstance['webComponentConstructed'].apply(appInstance, [proto]) | ||
appInstance['webComponentConstructed'].apply(appInstance, [webComponentInstance]) | ||
} | ||
@@ -45,3 +45,4 @@ } | ||
const styles = getStyleElementsFromReactWebComponentStyleLoader(); | ||
for (let i = 0; i < styles.length; i++) { | ||
const webComponentInstance = this; | ||
for (var i = 0; i < styles.length; i++) { | ||
shadowRoot.appendChild(styles[i]) | ||
@@ -52,3 +53,3 @@ } | ||
appInstance = this; | ||
callConstructorHook(proto); | ||
callConstructorHook(webComponentInstance); | ||
callLifeCycleHook('attachedCallback'); | ||
@@ -55,0 +56,0 @@ }); |
37830
0.24%80
1.27%