@fruit-ui/core 1.3.0 → 1.3.1
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/README.md +1 -3
- package/package.json +1 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -292,7 +292,7 @@ function createElementFromElementable(elementable, onMounts) {
|
|
|
292
292
|
function createElementFromComponent(component, onMounts) {
|
|
293
293
|
const boundProducer = bindTemplateProducer(component.render, component);
|
|
294
294
|
thisRecord[boundProducer.componentId] = boundProducer.this;
|
|
295
|
-
boundProducer.this.state = component.state ? component.state.call(boundProducer.this) : {};
|
|
295
|
+
boundProducer.this.state = typeof component.state === 'function' ? component.state.call(boundProducer.this) : component.state ?? {};
|
|
296
296
|
const template = boundProducer();
|
|
297
297
|
return createElementFromTemplate.call(boundProducer.this, giveTemplateComponentMetadata(template, boundProducer.componentId, component.key, component.binding), onMounts, boundProducer);
|
|
298
298
|
}
|