---
title: FAQ
---

# FAQ

## Why can't usePageEvent listen to page events in SdmProvider?

In miniapps, the page lifecycle is triggered in order: Page.onLoad → Component Rendering → useEffect / usePageEvent registration within the component.
To ensure device data is ready, `SdmProvider` uses asynchronous initialization (via APIs like `getDeviceInfo` / `getDeviceListByDevIds`). When `SdmProvider` delays the rendering of child components, the child components may be mounted and register event handlers after Page.onLoad has already occurred. This causes `usePageEvent('onLoad')` to never receive the onLoad event that has already been triggered.

**Solution**: It is currently recommended to use `useEffect` to listen for component mounting and unmounting as a replacement for listening to page lifecycle events.

## How to remove logging for every DP point command or report

In SDM, for the convenience of developer debugging, [interceptors](/en/miniapp/solution-panel/ability/common/sdm/interceptors/usage) are used by default to print information for every DP point command and report. If you want to remove these logs, you can achieve this by adjusting the priority of the Log configuration. Refer to the following example:

```diff
diff --git a/src/devices/index.ts b/src/devices/index.ts
index 05f6421..2ede1a1 100644
--- a/src/devices/index.ts
+++ b/src/devices/index.ts
@@ -9,6 +9,9 @@ export const dpKit = createDpKit<SmartDeviceSchema>({ protocols });
 
 const deviceOptions = {
   interceptors: dpKit.interceptors,
+  logConfig: {
+    level: 'FATAL',
+  },
 } as SmartDeviceModel<SmartDeviceSchema>['options'];
 
 /**
```
