Skip to Content

Basic React Recipe

๊ฐ€์žฅ ์ž‘์€ ์‹œ์ž‘์ ์ด ํ•„์š”ํ•˜๋ฉด examples/basic-react๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์‹œ์ž‘ํ•˜์„ธ์š”.

์ ํ•ฉํ•œ ๊ฒฝ์šฐ:

  • Vite + React
  • core editor๋งŒ ๋จผ์ € ๋ถ™์ด๊ณ  ์‹ถ์„ ๋•Œ
  • AI์—๊ฒŒ ์ตœ์†Œํ•œ์˜ ๊ธฐ์ค€ ํŒŒ์ผ์„ ์ฃผ๊ณ  ์‹ถ์„ ๋•Œ

์‹คํ–‰:

pnpm install pnpm --filter example-basic-react dev

ํ•ต์‹ฌ ํฌ์ธํŠธ:

  • @inkio/editor/minimal.css๋ฅผ importํ•ฉ๋‹ˆ๋‹ค.
  • getDefaultCoreExtensions()๋กœ ๊ธฐ๋ณธ editor ๊ตฌ์„ฑ์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.
  • Editor๋Š” uncontrolled ์ƒํƒœ๋กœ initialContent๋ฅผ ๋ฐ›๊ณ , onUpdate๋กœ ํ˜„์žฌ ๊ฐ’์„ ๋ฐ›์Šต๋‹ˆ๋‹ค.

์ฃผ์š” ํŒŒ์ผ:

  • examples/basic-react/src/App.tsx
  • examples/basic-react/src/main.tsx

AI์—๊ฒŒ ์š”์ฒญํ•  ๋•Œ๋Š” AI_CONTEXT.md์™€ ํ•จ๊ป˜ examples/basic-react/src/App.tsx๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์ˆ˜์ •ํ•˜๋ผ๊ณ  ์ฃผ๋Š” ๋ฐฉ์‹์ด ๊ฐ€์žฅ ์•ˆ์ •์ ์ž…๋‹ˆ๋‹ค.

Last updated on