@kayelaa/canvas API - v0.2.15
    Preparing search index...

    Function createElement

    • Creates a Kayla element descriptor (virtual representation of an entity/component).

      This is the JSX factory used internally by the transpiler. You rarely call it directly, but it powers declarative trees passed to scene.spawn().

      Type Parameters

      • Props extends FCProps

        Props type accepted by the component

      Parameters

      • fc: FC<Props>

        The functional component

      • props: Props

        Props including key, ref, exportsRef, children, etc.

      Returns KaylaElement<Props>

      Element descriptor

      const elem = createElement(Player, { x: 400, y: 300 });
      scene.spawn(elem);