@superblocksteam/custom-components-ephemeral
v2.0.43
Published
Official Superblocks SDK for developing custom components
Keywords
Readme
@superblocksteam/custom-components
Provides utility functions to help develop custom components that can be used in Superblocks Applications.
Usage
import React from "react";
import { useSuperblocksContext } from "@superblocksteam/custom-components";
import { type Props, type EventTriggers } from "./types";
export default function Component({ count }: Props) {
const {
updateProperties,
events: { onChange },
} = useSuperblocksContext<Props, EventTriggers>();
return (
<button
onClick={() => {
updateProperties({ count: count + 1 });
onChange();
}}
>
Increment
</button>
);
}