Skip to main content

Full-Code Component Interface Specifications

Full-code components are built with React and must adhere to specific interface contracts and code structures. This guide explains the core interfaces, file layout, and development conventions for full-code components.

:::: Full-code components are scoped to the current page, whereas custom component types can be reused across multiple pages. They are ideal for rapid prototyping and evolving requirements.

To create full-code components, see: Creating full-code components ::::

Component interface architecture

Loading...

Full-code components follow a standard three-layer architecture: Page renderer, Page logic class, and Component interface. The platform treats page composition as a black box; you only need to work with three core interfaces:

Core interface definitions

  • Page renderer (PageRender.tsx): Renders the entire page by invoking the platform ElementRender interface.
  • Page class (page.ts): Implements Jit.GridPage; manages component instances and event subscriptions.
  • Component class (BlankComponent2.tsx): Extends Jit.BaseComponent; defines the Render function and logic methods.

Interface interaction mechanism

The platform injects the component logic instance into the renderer via props.compIns, separating UI from logic. ElementRender manages component lifecycles and data flow.

Interface implementation specifications

Full-code components must comply with these implementation rules:

import PageCls from "./page";
import Render from "./PageRender";

export { PageCls, Render };

Interface runtime sequence

Interface invocation explanation

The core invocation mechanism for full-code component interfaces:

  • Page interface: PageRender calls ElementRender; the platform generates the component tree based on the scheme.json configuration.
  • Component interface: The platform creates the component logic instance and passes it to the renderer via the props.compIns interface.
  • Event interface: Render invokes logic methods and publishes events via the compIns interface; page.ts subscribes via the bindEvent() interface.
JitAI AssistantBeta
Powered by JitAI