# एडिटर बनाएँ {#use-editor}

Source: [एडिटर बनाएँ | Yurich React एडिटर का API रेफ़रेंस · Yurich](https://leeyujoo.com/yurich/hi/api/use-editor/)

Package: [`yurich`](https://www.npmjs.com/package/yurich)

Package version: `0.1.2`

```ts
declare function useEditor(options: EditorOptions): EditorInstance;

type EditorOptions = {
  extensions: Extension[];
  initialValue?: string;
  onChange?: (html: string) => void;
  onChangeJSON?: (json: DocumentJSON) => void;
  sanitize?: boolean;
  historyLimit?: number;
};
```

`extensions` आवश्यक है। `initialValue` शुरुआती HTML है और एक बार पढ़ा जाता है। `historyLimit` का डिफ़ॉल्ट 100 है। `sanitize` डिफ़ॉल्ट रूप से `true` है और HTML आउटपुट पर लागू होता है।

`onChange` HTML और `onChangeJSON` JSON देता है। हर फ़्रेम में अधिकतम एक रिपोर्ट आती है। `{ history: false }` में समान HTML पर भी कॉलबैक चल सकता है।
