I have async fnction and 2 block of template, function called in render But instead of template I get objectPromise Why it happens and how fix it?
async renderTabsDependOnStatusAccess() {
if (true) {
return this.renderTabsAfterLogin()
} else {
return this.renderTabsBeforeLogin()
}
}
render() {
return (
<div class="navigation">
${this.renderTabsDependOnStatusAccess()}
</div>
);
}
awaitthe resolved value of a Promise (which is what an async function returns). However, it looks like there's no need for your function here to be async. Is there more to your implementation than you have shared?