Stone.js API
    Preparing search index...

    Interface IView<DataType, VNode, EventType>

    A view page: a loader (handle), an optional head, and a render function.

    This mirrors the React IPage but keeps the node type generic so the same contract describes a Vue component, a string template, or any other engine's output.

    interface IView<DataType = unknown, VNode = unknown, EventType = unknown> {
        handle?: (event: EventType) => DataType | Promise<DataType>;
        head?: (
            context: ViewRenderContext<DataType>,
        ) => HeadContext | Promise<HeadContext>;
        render: (context: ViewRenderContext<DataType>) => VNode;
    }

    Type Parameters

    • DataType = unknown

      Data returned by handle().

    • VNode = unknown

      The engine's node type (JSX element, VNode, …).

    • EventType = unknown

      The incoming event type.

    Index
    handle?: (event: EventType) => DataType | Promise<DataType>
    head?: (
        context: ViewRenderContext<DataType>,
    ) => HeadContext | Promise<HeadContext>
    render: (context: ViewRenderContext<DataType>) => VNode