Skip to content

Instantly share code, notes, and snippets.

@yasudacloud
Created November 9, 2025 14:28
Show Gist options
  • Select an option

  • Save yasudacloud/13ccb20861047abf754189390dd0e6d8 to your computer and use it in GitHub Desktop.

Select an option

Save yasudacloud/13ccb20861047abf754189390dd0e6d8 to your computer and use it in GitHub Desktop.
import {
defineProperties,
useEffect,
useState,
} from "figma:react";
export default function Layer({ text }) {
const [data, setData] = useState([]);
useEffect(() => {
fetch("http://localhost:3000/example").then(
async (response) => {
setData(await response.json());
},
);
}, []);
return (
<div>
{data.map((text) => (
<p key={text}>{text}</p>
))}
</div>
);
}
defineProperties(Layer, {
text: {
label: "Text",
type: "string",
defaultValue: "Code layer",
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment