Function ComponentType

  • Defines a new component type with a unique symbol and associated data.

    Type Parameters

    • T

      The data schema for the component.

    Returns {
        create: ((data) => {
            data: T;
            type: symbol;
        });
        data: T;
        type: symbol;
    }

    An object with properties: type, data, and a create function.

    • create: ((data) => {
          data: T;
          type: symbol;
      })
        • (data): {
              data: T;
              type: symbol;
          }
        • Parameters

          • data: T

          Returns {
              data: T;
              type: symbol;
          }

          • data: T
          • type: symbol
    • data: T
    • type: symbol