@superblocksteam/custom-components
v1.9.0
Published
Official Superblocks SDK for developing custom components
Downloads
95
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>
);
}