Is it possible to set lightning component aura:id attribute dynamically while creating the component?
Here is my code for the component creation:
$A.createComponent(
"c:RPGFlowComponent",
{
flow: {
Id: flowId
}
},
helper.setUpperRightComponent(component)
);
setUpperRightComponent: function(component) {
return function(newComponent, status, errorMessage) {
if (status === "SUCCESS") {
const rightLowerPart = component.find("rightUpperComponent");
const body = [];
body.push(newComponent);
rightLowerPart.set("v.body", body);
}
else if (status === "INCOMPLETE") {
console.log("INCOMPLETE")
}
else if (status === "ERROR") {
console.log("ERROR: " + errorMessage);
}
}
}
How could I modify it to set the aura:id
attribute on it?