Skip to content

Commit e1ba280

Browse files
committed
Updates to parent
1 parent 8eee1d6 commit e1ba280

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tApp.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class tApp {
99
static currentHash = "/";
1010
static debugComponentTiming;
1111
static get version() {
12-
return "v0.10.4";
12+
return "v0.10.5";
1313
}
1414
static configure(params) {
1515
if(params == null) {
@@ -612,6 +612,10 @@ class tApp {
612612
if(component.parent != null) {
613613
parentState = component.parent.state;
614614
}
615+
let parentId = null;
616+
if(component.parent != null) {
617+
parentId = component.parent.id;
618+
}
615619
let count = htmlToDOMCount(rendered);
616620
if(count != 1) {
617621
throw "tAppComponentError: Component render output must contain exactly one node/element but can contain subnodes/subelements. To resolve this issue, wrap the entire output of the render in a div or another grouping element. If you only have one node/element, unintentional whitespace at the beginning or end of the render output could be the source of the issue since whitespace can be interpreted as a text node/element.";
@@ -623,9 +627,11 @@ class tApp {
623627
props: props,
624628
state: component.state,
625629
parent: {
626-
state: parentState
630+
state: parentState,
631+
id: parentId
627632
},
628-
_this: "tApp.getComponent(this.getAttribute('tapp-component'))"
633+
_this: "tApp.getComponent(this.getAttribute('tapp-component'))",
634+
_parent: `tApp.getComponent("${parentId}")`
629635
}, component.id);
630636
} else {
631637
function trim(str) {

0 commit comments

Comments
 (0)