What Can I Do If the onShow Lifecycle Function Is Not Triggered?

Symptom

When a user is redirected to a quick app page that references only a single custom element through the router.push API, the onShow lifecycle function for that page cannot be triggered, as shown in the following figure.

The code where the exception occurs is as follows:

Code of the custom element (aa.ux):

Cause Analysis

Huawei Quick App Loader does not trigger the onShow lifecycle function if the root node of the page is a custom element. However, the function can be triggered for a subelement.

Solution

Add the div element, instead of a custom element, as the root node.

The modified code is as follows:

--

--

--

Lead Developer Advocate for Huawei AppGallery | He/Him | All views are my own and do not represent the views of Huawei

Love podcasts or audiobooks? Learn on the go with our new app.

“Props” in React…

Writing PHP and JS with Vim in 2017

Common JavaScript questions — are JavaScript objects hash tables?? And more

Convert Existing React Components into WebComponents

Want to do a Project

[Javascript] Pass By Value And Pass By Reference In JavaScript

Using the Cloud DB JavaScript Server SDK in Cloud Functions

Angular Concepts

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Zachary Powell

Zachary Powell

Lead Developer Advocate for Huawei AppGallery | He/Him | All views are my own and do not represent the views of Huawei

More from Medium

Ranking 200 Random Buy-to-Play Steam Games [Part IV: 84-??]

Understanding Proxy and Reverse Proxy Servers

https://networkencyclopedia.com/proxy-server/

GSoC 2015 — Moorsp Plagiarism Plugin for Moodle

Autowiring in Spring