anyuianyui
Home
Getting Started
Documentation
Download
  • English
  • 简体中文
Home
Getting Started
Documentation
Download
  • English
  • 简体中文
  • Setup

    • Installation
  • Core Concepts

    • Introduction
    • Design
    • Hide and Lock
    • Resource Management
  • Higher Order Component

    • State Button
    • Label Slider
    • Value Slider
    • Check Group & Radio Group
    • StatusBar
    • NavigateBar
    • Drawer
  • Advanced Features

    • Use External Image File as Source
    • GIF Animated Image
    • Template Component
    • Global Components
    • Screen Management
    • Communication Commands and Events
    • Lottie Animation
  • Development

    • Build Mode
    • Build Toolchain Configuration
    • Code Transplant
  • Technical Support

    • FAQ

What is a Higher Order Component (HoC)?

A Higher Order Component is a composite component that encapsulates multiple components with predefined behaviors for self-managed UI state control.

Capabilities

HoC components offer the following functionality:

  • Selection, duplication, deletion, dragging, and movement as a unified entity
  • Visibility toggling
  • Visual customization through editing
  • Predefined behavior management for UI states, such as StateButton which automatically synchronizes image and label updates based on state changes, allowing developers to focus on business logic

Limitations

HoC components have the following restrictions:

  • Direct resizing is not supported; modifications require changes to wrapped components
  • Addition, removal, or reordering of encapsulated components is prohibited
  • Behavioral modification of the HoC is not permitted

Using Higher Order Components

To utilize HoC components:

  1. Expand the WidgetBar to reveal the HoC section:

Widget Bar

HoC Bar

  1. Drag and drop the desired HoC from the WidgetBar to the screen
  2. Use the HoC as you would a standard component