react-figma
3. boilerplate ์ค์น ๋ฐ ์คํ
๋ฐฉ๊ธ ์ค์นํ boilerplate ํ๋ก์ ํธ๋ฅผ VSCODE๋ก ์ผ ๋ค์
npm install
npm webpack:watch
์ฐจ๋ก๋ก ์ ๋ ฅํด์ฃผ๋ฉด distํด๋๊ฐ ๋ง๋ค์ด์ง๋ค.
4. ํผ๊ทธ๋ง์ ํ๋ฌ๊ทธ์ธ ์ฐ๊ฒฐ

ํผ๊ทธ๋ง ์ข์ธก ๋ฉ๋ด์์ Draft๋ฅผ ๋๋ฅธ๋ค.

์ฐ์ธก ๋ฉ๋ด์์ Plugins > Manage Plugins ํด๋ฆญ

In Development์์ Create your own plugin ์ +
ํด๋ฆญ
(์ฐ๋ฆฌ๋ ์ด๋ฏธ ๋ง๋ค์ด์ง boilerplate๋ฅผ ํผ๊ทธ๋ง์ ์ฐ๊ฒฐํ ๊ฒ์ด๋ฏ๋ก ์๋ก ์์ฑํ๋๊ฒ ์๋๋ผ ๊ธฐ์กด์ ์๋๊ฑธ ์ฐ๊ฒฐํ๋๊ฒ์)

์๋ choose a manifest.json ํด๋ฆญ

manifest.json ํ์ผ ์ ํํ ์๋ฃ

์ด์ react-figma ํ๋ฌ๊ทธ์ธ์ด ์ ์์ ์ผ๋ก ํผ๊ทธ๋ง๋ก ์ฐ๊ฒฐ๋์๋ค.
์ด์ ์ฝ๋๋ฅผ ๋ณ๊ฒฝํ์๋ ํผ๊ทธ๋ง์์ ์ ๋๋ก ๋ ๋๋ง ๋๋์ง ์์๋ณด์.

Draft๋ก ๋ค์ ๊ฐ์ ์ฐ์ธก ๋ฉ๋ด๋ฅผ ๋๋ฅธ๋ค์ ๋ฐฉ๊ธ ์ถ๊ฐํ ํ๋ฌ๊ทธ์ธ์ ์ ํํ๋ค.

์ด๋ฐ ํ๋ฉด์ด ๋ด๋ค๋ฉด ์ฑ๊ณต
๋ค์ vscode๋ก ๋์๊ฐ์ ์ฝ๋๋ฅผ ์์ ํด๋ณด์.
src/App.tsx์ ์ฝ๋์์ ์๋ Rectangle์ ์์ yellow๋ก ๋ฐ๊ฟ๋ณด์.
import * as React from "react";
import { Page, Rectangle, Text } from "react-figma";
export const App = () => {
return (
<Page isCurrent name="Page X">
<Text characters="Hello, react-figma!" />
<Rectangle style={{ width: 200, height: 100, backgroundColor: "#0ddd25" }} />
<Rectangle style={{ width: 200, height: 100, backgroundColor: "yellow" }} /> // yellow๋ก ๋ณ๊ฒฝ๋จ.
</Page>
);
};
๋ค์ ํผ๊ทธ๋ง๋ก ๋์๊ฐ์

Run Last Plugin์ ๋๋ฅด๊ฑฐ๋ Ctrl + Alt + P(์๋์ฐ), โฅโP(๋งฅ)์ ํตํด์ ํ๋ฌ๊ทธ์ธ์ ์ฌ์คํ์์ผ๋ณด์.

์ ์์ ์ผ๋ก ๋ณ๊ฒฝ๋์์ผ๋ฉด ์ฑ๊ณต

Last updated
Was this helpful?