@quintype/framework 7.8.0 → 7.8.1-dom-render.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/start.js +9 -2
- package/package.json +1 -1
package/client/start.js
CHANGED
|
@@ -181,10 +181,17 @@ export function maybeSetUrl(path, title) {
|
|
|
181
181
|
export function renderComponent(clazz, container, store, props = {}, callback) {
|
|
182
182
|
const component = React.createElement(Provider, { store }, React.createElement(clazz, props || {}));
|
|
183
183
|
|
|
184
|
+
const containerEle = document.getElementById(container);
|
|
185
|
+
|
|
186
|
+
if(!containerEle){
|
|
187
|
+
console && console.log(`Rendering component on DOM id ${container} FAILED, node not available`);
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
|
|
184
191
|
if (props.hydrate) {
|
|
185
|
-
return ReactDOM.hydrate(component,
|
|
192
|
+
return ReactDOM.hydrate(component, containerEle, callback);
|
|
186
193
|
}
|
|
187
|
-
return ReactDOM.render(component,
|
|
194
|
+
return ReactDOM.render(component, containerEle, callback);
|
|
188
195
|
}
|
|
189
196
|
|
|
190
197
|
/**
|