Listens on the event that a page to be opened by the Mini Program does not exist. The callback timing for this event is consistent with that of
- Developers can implement page redirection during callback only when the callback processing is synchronous. This approach is invalid for asynchronous processing (such as the asynchronous execution of setTimeout).
- If the developer neither calls the Taro.onPageNotFound for listening nor declares App.onPageNotFound, when the redirected page does not exist, the WeChat app's native 404 page is pushed.
- If the callback redirects to another page that does not exist, the WeChat app's native 404 page is pushed and the API is not called back again.
(callback: Callback) => void
|isEntryPage||Indicates whether this is the first page for this launch (for example, from sharing and other entries, the first page is the shared page configured by the developer).|
|path||The path to the nonexistent page|
|query||The query parameter for the nonexistent page|
The callback function for the event that a page to be opened by the Mini Program does not exist.
(res: Result) => void
|API||WeChat Mini-Program||H5||React Native|