usePanelConfig()
Requires:
@ray-js/panel-sdk≥1.12.0
Description
Retrieve the product configuration for the panel mini program at runtime, such as scheduling settings, navigation link settings, custom settings, etc.
Parameters
None
Return Value
Type: Config
Config object that includes iot (IoT public configuration), fun (feature configuration), bic (cloud timers/navigation links), themeInfo (theme CSS variables), and initialized (whether loading is complete)
Config
| Property | Type | Description |
|---|---|---|
initialized | boolean | Whether initialization is complete |
| IoT product configuration, supported only on the public panel | ||
| IoT feature configuration | ||
| Cloud timers and navigation links configured on the IoT platform | ||
| Miniapp theme configuration data |
Valid Values
ThemeValue.rangeType
| Value | Description | Since |
|---|---|---|
bool | - | - |
enum | - | - |
blank | - | - |
IoTPublicConfig.theme
| Value | Description | Since |
|---|---|---|
default | - | - |
light | - | - |
FunConfig.tyabirysr4_app
| Value | Description | Since |
|---|---|---|
follow | - | - |
--app-B1 | - | - |
FunConfig.tyabis5d9w_app
| Value | Description | Since |
|---|---|---|
follow | - | - |
--app-M1 | - | - |
Examples
Example
FAQs
Q: Why can this hook crash when used under the App root component?
A: usePanelConfig depends on the Page ready event internally. Do not use this hook directly under the App root component before the first page render is complete.
Q: Where does runtime panel config come from?
The images below show:
- Image 1: Timer and jump-link config, corresponding to
panelConfig.bic. - Images 2 and 3: Custom cloud capability entry and config page, corresponding to
panelConfig.fun.