{"_id":"@aaaahoang123/react-simplemde-editor","_rev":"3-d1fa54a07082463b39106fa3834bb95e","name":"@aaaahoang123/react-simplemde-editor","dist-tags":{"latest":"5.2.4"},"versions":{"5.2.1":{"name":"@aaaahoang123/react-simplemde-editor","homepage":"https://react-simplemde-edtior.netlify.app/","repository":{"type":"git","url":"git+https://github.com/RIP21/react-simplemde-editor.git"},"version":"5.2.1","author":{"name":"Andrii Los"},"contributors":[{"name":"Ben Lodge","email":"benrlodge@gmail.com","url":"https://github.com/benrlodge"}],"license":"MIT","main":"dist/SimpleMdeReact.js","module":"dist/SimpleMdeReact.mjs","typings":"dist/SimpleMdeReact.d.ts","scripts":{"build:lib":"tsup ./src/SimpleMdeReact.tsx","prepare":"pnpm build:lib","demo":"vite","build:demo":"vite build","test":"vitest","test:e2e":"playwright test","test:e2e:debug":"playwright test --debug","tsc":"tsc"},"dependencies":{"@types/codemirror":"~5.60.5"},"peerDependencies":{"easymde":">= 2.0.0 < 3.0.0","react":">=16.8.2","react-dom":">=16.8.2"},"devDependencies":{"@playwright-testing-library/test":"~4.5.0","@playwright/test":"~1.26.1","@testing-library/react":"~13.4.0","@testing-library/user-event":"~14.4.3","@types/codemirror":"~5.60.5","@types/node":"~16.11.62","@types/react":"~18.0.21","@types/react-dom":"~18.0.6","easymde":"~2.18.0","happy-dom":"~6.0.4","jsdom":"~20.0.0","prettier":"~2.7.1","react":"18.2.0","react-dom":"18.2.0","tsup":"~6.2.3","typescript":"~4.8.4","vite":"~3.1.4","vitest":"0.23.4","vitest-dom":"~0.0.4"},"gitHead":"6e36bf67265fa03a337948aa6a1a735eef0847a1","description":"[![NPM version][npm-badge]][npm]","bugs":{"url":"https://github.com/RIP21/react-simplemde-editor/issues"},"_id":"@aaaahoang123/react-simplemde-editor@5.2.1","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-mWf/gC1u4OM6lUTAHyHBYD/VqIxhiIIB9+jqf+dsUGLTJSUSq57bXXHo1fLc7bGXOl8VVLE6RMQpRsd+fak7Rw==","shasum":"0c3af15872e90e057f2bdea7758caececb299922","tarball":"https://registry.npmjs.org/@aaaahoang123/react-simplemde-editor/-/react-simplemde-editor-5.2.1.tgz","fileCount":23,"unpackedSize":78264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCa8qffKOvHy06Gm/3wmaOiMimganz+auqjEQoOHOi3SwIgUVTH20CSbcIpg2zly2NPCeT5zN2H3E7/pH99iarjO68="}]},"_npmUser":{"name":"aaaahoang123","email":"hoangdo.2194@gmail.com"},"directories":{},"maintainers":[{"name":"aaaahoang123","email":"hoangdo.2194@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-simplemde-editor_5.2.1_1686718501900_0.20569801135661803"},"_hasShrinkwrap":false},"5.2.2":{"name":"@aaaahoang123/react-simplemde-editor","homepage":"https://react-simplemde-edtior.netlify.app/","repository":{"type":"git","url":"git+https://github.com/RIP21/react-simplemde-editor.git"},"version":"5.2.2","author":{"name":"Andrii Los"},"contributors":[{"name":"Ben Lodge","email":"benrlodge@gmail.com","url":"https://github.com/benrlodge"}],"license":"MIT","main":"dist/SimpleMdeReact.js","module":"dist/SimpleMdeReact.mjs","typings":"dist/SimpleMdeReact.d.ts","scripts":{"build:lib":"tsup ./src/SimpleMdeReact.tsx","prepare":"pnpm build:lib","demo":"vite","build:demo":"vite build","test":"vitest","test:e2e":"playwright test","test:e2e:debug":"playwright test --debug","tsc":"tsc"},"dependencies":{"@types/codemirror":"~5.60.5"},"peerDependencies":{"easymde":">= 2.0.0 < 3.0.0","react":">=16.8.2","react-dom":">=16.8.2"},"devDependencies":{"@playwright-testing-library/test":"~4.5.0","@playwright/test":"~1.26.1","@testing-library/react":"~13.4.0","@testing-library/user-event":"~14.4.3","@types/codemirror":"~5.60.5","@types/node":"~16.11.62","@types/react":"~18.0.21","@types/react-dom":"~18.0.6","easymde":"~2.18.0","happy-dom":"~6.0.4","jsdom":"~20.0.0","prettier":"~2.7.1","react":"18.2.0","react-dom":"18.2.0","tsup":"~6.2.3","typescript":"~4.8.4","vite":"~3.1.4","vitest":"0.23.4","vitest-dom":"~0.0.4"},"gitHead":"16cb0810f086e71cce40c4cd87d69dab533c92c9","description":"[![NPM version][npm-badge]][npm]","bugs":{"url":"https://github.com/RIP21/react-simplemde-editor/issues"},"_id":"@aaaahoang123/react-simplemde-editor@5.2.2","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-w8o1hGaInPg75vQAmdT1ucp8UTwaCbLZX7M6r8XfjWa/y0V9tJbU9GbRDwv6LM4ZzzQicDZqEa4CzJrzPKWArQ==","shasum":"9ade3fd0272e44d6e47f48afab10f67a23450888","tarball":"https://registry.npmjs.org/@aaaahoang123/react-simplemde-editor/-/react-simplemde-editor-5.2.2.tgz","fileCount":23,"unpackedSize":78264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVKrtbrXuUYhUC2W9k4B7w46gGHPeSOyCz946ZavVRTAIgX6C1GE7Bkl3cpFk31L7dn9vuJFqM0Q9Wg753Lxy1KBA="}]},"_npmUser":{"name":"aaaahoang123","email":"hoangdo.2194@gmail.com"},"directories":{},"maintainers":[{"name":"aaaahoang123","email":"hoangdo.2194@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-simplemde-editor_5.2.2_1686719144959_0.8205216888275517"},"_hasShrinkwrap":false},"5.2.3":{"name":"@aaaahoang123/react-simplemde-editor","homepage":"https://react-simplemde-edtior.netlify.app/","repository":{"type":"git","url":"git+https://github.com/RIP21/react-simplemde-editor.git"},"version":"5.2.3","author":{"name":"Andrii Los"},"contributors":[{"name":"Ben Lodge","email":"benrlodge@gmail.com","url":"https://github.com/benrlodge"}],"license":"MIT","main":"dist/SimpleMdeReact.js","module":"dist/SimpleMdeReact.mjs","typings":"dist/SimpleMdeReact.d.ts","scripts":{"build:lib":"tsup ./src/SimpleMdeReact.tsx","prepare":"pnpm build:lib","demo":"vite","build:demo":"vite build","test":"vitest","test:e2e":"playwright test","test:e2e:debug":"playwright test --debug","tsc":"tsc"},"dependencies":{"@types/codemirror":"~5.60.5"},"peerDependencies":{"easymde":">= 2.0.0 < 3.0.0","react":">=16.8.2","react-dom":">=16.8.2"},"devDependencies":{"@playwright-testing-library/test":"~4.5.0","@playwright/test":"~1.26.1","@testing-library/react":"~13.4.0","@testing-library/user-event":"~14.4.3","@types/codemirror":"~5.60.5","@types/node":"~16.11.62","@types/react":"~18.0.21","@types/react-dom":"~18.0.6","easymde":"~2.18.0","happy-dom":"~6.0.4","jsdom":"~20.0.0","prettier":"~2.7.1","react":"18.2.0","react-dom":"18.2.0","tsup":"~6.2.3","typescript":"~4.8.4","vite":"~3.1.4","vitest":"0.23.4","vitest-dom":"~0.0.4"},"gitHead":"16cb0810f086e71cce40c4cd87d69dab533c92c9","description":"[![NPM version][npm-badge]][npm]","bugs":{"url":"https://github.com/RIP21/react-simplemde-editor/issues"},"_id":"@aaaahoang123/react-simplemde-editor@5.2.3","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-oE6LP/kFc1cL1zQs4fWXKBt+anIUTMJ4c7ZH9prGM3g7aEmy4oKWP4Dzm3InTw4WS3f6SIKx3X3WVU4IkviU5g==","shasum":"b1845193295a9be7cc80c2d1a83b5587329d9a94","tarball":"https://registry.npmjs.org/@aaaahoang123/react-simplemde-editor/-/react-simplemde-editor-5.2.3.tgz","fileCount":23,"unpackedSize":78264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA03MC+UhPLWaMTlH9fgA3bZo2N1Es1+6zeUh39ewJUcAiEA4Ya0ftT2oBTmFfbxa38YL02UfUChdgTVnxPvFa7j5xI="}]},"_npmUser":{"name":"aaaahoang123","email":"hoangdo.2194@gmail.com"},"directories":{},"maintainers":[{"name":"aaaahoang123","email":"hoangdo.2194@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-simplemde-editor_5.2.3_1686720097327_0.19046470674839733"},"_hasShrinkwrap":false},"5.2.4":{"name":"@aaaahoang123/react-simplemde-editor","homepage":"https://react-simplemde-edtior.netlify.app/","repository":{"type":"git","url":"git+https://github.com/RIP21/react-simplemde-editor.git"},"version":"5.2.4","author":{"name":"Andrii Los"},"contributors":[{"name":"Ben Lodge","email":"benrlodge@gmail.com","url":"https://github.com/benrlodge"}],"license":"MIT","main":"dist/SimpleMdeReact.js","module":"dist/SimpleMdeReact.mjs","typings":"dist/SimpleMdeReact.d.ts","scripts":{"build:lib":"tsup ./src/SimpleMdeReact.tsx","prepare":"pnpm build:lib","demo":"vite","build:demo":"vite build","test":"vitest","test:e2e":"playwright test","test:e2e:debug":"playwright test --debug","tsc":"tsc"},"dependencies":{"@types/codemirror":"~5.60.5"},"peerDependencies":{"easymde":">= 2.0.0 < 3.0.0","react":">=16.8.2","react-dom":">=16.8.2"},"devDependencies":{"@playwright-testing-library/test":"~4.5.0","@playwright/test":"~1.26.1","@testing-library/react":"~13.4.0","@testing-library/user-event":"~14.4.3","@types/codemirror":"~5.60.5","@types/node":"~16.11.62","@types/react":"~18.0.21","@types/react-dom":"~18.0.6","easymde":"~2.18.0","happy-dom":"~6.0.4","jsdom":"~20.0.0","prettier":"~2.7.1","react":"18.2.0","react-dom":"18.2.0","tsup":"~6.2.3","typescript":"~4.8.4","vite":"~3.1.4","vitest":"0.23.4","vitest-dom":"~0.0.4"},"gitHead":"16cb0810f086e71cce40c4cd87d69dab533c92c9","description":"[![NPM version][npm-badge]][npm]","bugs":{"url":"https://github.com/RIP21/react-simplemde-editor/issues"},"_id":"@aaaahoang123/react-simplemde-editor@5.2.4","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-BUKZvgFKBg3ACZTTakKG4YVi8PdgRZPD4l/2etMFoA5Vy36YEytIb6lrlW1qGVYdNQ9pVC1j3S7NI0LdDBQERg==","shasum":"7a2a6f15357d81ceeb65caad96363e5fdb6a22bf","tarball":"https://registry.npmjs.org/@aaaahoang123/react-simplemde-editor/-/react-simplemde-editor-5.2.4.tgz","fileCount":8,"unpackedSize":57662,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwCS8/ho/ZJVUh0pZRMDKwmaEOTm1qs6JTwHCyrit8mQIhAKDzPk5fPV8tNXM9+6aOODDlBuOLh2dy7OyA22sPkPlb"}]},"_npmUser":{"name":"aaaahoang123","email":"hoangdo.2194@gmail.com"},"directories":{},"maintainers":[{"name":"aaaahoang123","email":"hoangdo.2194@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-simplemde-editor_5.2.4_1686720235717_0.5456622549598793"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-14T04:55:01.826Z","5.2.1":"2023-06-14T04:55:02.131Z","modified":"2023-06-14T05:23:55.983Z","5.2.2":"2023-06-14T05:05:45.217Z","5.2.3":"2023-06-14T05:21:37.501Z","5.2.4":"2023-06-14T05:23:55.882Z"},"maintainers":[{"name":"aaaahoang123","email":"hoangdo.2194@gmail.com"}],"description":"[![NPM version][npm-badge]][npm]","homepage":"https://react-simplemde-edtior.netlify.app/","repository":{"type":"git","url":"git+https://github.com/RIP21/react-simplemde-editor.git"},"contributors":[{"name":"Ben Lodge","email":"benrlodge@gmail.com","url":"https://github.com/benrlodge"}],"author":{"name":"Andrii Los"},"bugs":{"url":"https://github.com/RIP21/react-simplemde-editor/issues"},"license":"MIT","readme":"# React SimpleMDE (EasyMDE) Markdown Editor\n\n[![NPM version][npm-badge]][npm]\n\nReact component wrapper for\n[EasyMDE (the most fresh SimpleMDE fork)](https://github.com/Ionaru/easy-markdown-editor).\n\nOnly two dependencies, React (peer) and EasyMDE (peer).\n\nBuilt by [@RIP21](https://twitter.com/rip212) 👨‍💻\n\n- [New in v5](#new-in-v5)\n- [Install](#install)\n- [Demo](#demo)\n- [Usage](#usage)\n  - [Controlled usage](#controlled-usage)\n  - [Options](#options)\n  - [Hotkeys](#hotkeys)\n  - [Custom preview rendering example](#custom-preview-rendering-example)\n  - [Events / Additional event listeners for events of CodeMirror](#events--additional-event-listeners-for-events-of-codemirror)\n  - [Autosaving](#autosaving)\n  - [Retrieve `easymde`, `codemirror` or `cursor` info to be able to manipulate it.](#retrieve-easymde-codemirror-or-cursor-info-to-be-able-to-manipulate-it)\n  - [Basic testing](#basic-testing)\n- [API](#api)\n  - [Props](#props)\n  - [All exports list](#all-exports-list)\n- [Changelog](#changelog)\n  - [New in v4](#new-in-v4)\n  - [New in v3](#new-in-v3)\n  - [New in v2](#new-in-v2)\n\n<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>\n\n## New in v5\n\n- [breaking] Full rewrite to hooks. Means more reactive so, probably, less bugs related with updates. Minimum React version required `>=16.8.2`\n- [breaking] `easymde` now a peer dependency, please install it manually\n- [breaking] `label` prop has been removed\n- [breaking] SSR safe nets removed, please make sure to import it dynamically\n- [breaking] `options` shall be memoized to prevent new instances from being created on each render and other related to that bugs (more on that below)\n- [potentially-breaking] Forwards `ref`, so you can easily get access to `div` wrapper by using `ref` prop.\n- [potentially-breaking] Lots of bugs fixed, examples updated\n- [potentially-breaking] `@babel/runtime` helpers are no longer inlined but imported.\n\n## Install\n\n```\nnpm install --save react-simplemde-editor easymde\n```\n\nNote: Possibly you may need to install `@babel/runtime`, try without it, but if you don't have any issues, then you shouldn't.\n\n## Demo\n\n[Hosted demo](https://react-simplemde-edtior.netlify.com/)\n\nor to see it locally:\n\n```\ngit clone https://github.com/RIP21/react-simplemde-editor.git\ncd react-simplemde-editor\nyarn install\nyarn demo\nopen browser at localhost:3000\n```\n\n## Usage\n\nView the [demo code](https://github.com/rip21/react-simplemde-editor/tree/master/src/demo) for more examples.\n\nAll examples below are in TypeScript\n\nUncontrolled usage\n\n```tsx\nimport React from \"react\";\nimport SimpleMDE from \"react-simplemde-editor\";\nimport \"easymde/dist/easymde.min.css\";\n\n<SimpleMDE />;\n```\n\n### Controlled usage\n\n```tsx\nexport const ControlledUsage = () => {\n  const [value, setValue] = useState(\"Initial value\");\n\n  const onChange = useCallback((value: string) => {\n    setValue(value);\n  }, []);\n\n  return <SimpleMdeReact value={value} onChange={onChange} />;\n};\n```\n\n### Options\n\nYou can set API of [SimpleMDE options](https://github.com/Ionaru/easy-markdown-editor#configuration) which you pass down as a `options` prop.\nIf you're using TypeScript it will be inferred by compiler.\n\nNote: if you don't specify a custom id it will automatically generate an id for you.\n\nNote that you need to `useMemo` to memoize `options` so they do not change on each rerender! It will affect behavior and performance\nbecause then on each render of the parent that renders `SimpleMdeReact` you'll get a new instance of the editor, which you definitely want to avoid!\nAlso, if you change `options` on each `value` change you will lose focus.\nSo, put `options` as a `const` outside of the component, or if `options` shall be partially or fully set by `props` make sure to `useMemo` in\ncase of functional/hooks components, or class field for `class` based components.\nSlightly more on that here: [#164](https://github.com/RIP21/react-simplemde-editor/issues/164)\n\n```tsx\nexport const UsingOptions = () => {\n  const [value, setValue] = useState(\"Initial\");\n\n  const onChange = useCallback((value: string) => {\n    setValue(value);\n  }, []);\n\n  const autofocusNoSpellcheckerOptions = useMemo(() => {\n    return {\n      autofocus: true,\n      spellChecker: false,\n    } as SimpleMDE.Options;\n  }, []);\n\n  return (\n    <SimpleMdeReact\n      options={autofocusNoSpellcheckerOptions}\n      value={value}\n      onChange={onChange}\n    />\n  );\n};\n```\n\n### Hotkeys\n\nYou can include key maps using the `extraKeys` prop.\nRead more at [CodeMirror extra keys](https://codemirror.net/doc/manual.html#option_extraKeys)\n\n```tsx\nexport const UpdateableByHotKeys = () => {\n  const extraKeys = useMemo<KeyMap>(() => {\n    return {\n      Up: function (cm) {\n        cm.replaceSelection(\" surprise. \");\n      },\n      Down: function (cm) {\n        cm.replaceSelection(\" surprise again! \");\n      },\n    };\n  }, []);\n\n  const [value, setValue] = useState(\"initial\");\n  const onChange = (value: string) => setValue(value);\n\n  return (\n    <SimpleMdeReact value={value} onChange={onChange} extraKeys={extraKeys} />\n  );\n};\n```\n\n### Custom preview rendering example\n\n```tsx\nimport ReactDOMServer from \"react-dom/server\";\n\nexport const CustomPreview = () => {\n  const customRendererOptions = useMemo(() => {\n    return {\n      previewRender() {\n        return ReactDOMServer.renderToString(\n          <ReactMarkdown\n            source={text}\n            renderers={{\n              CodeBlock: CodeRenderer,\n              Code: CodeRenderer,\n            }}\n          />\n        );\n      },\n    } as SimpleMDE.Options;\n  }, []);\n\n  return (\n    <div>\n      <h4>Custom preview</h4>\n      <SimpleMdeReact options={customRendererOptions} />\n    </div>\n  );\n};\n```\n\n### Events / Additional event listeners for events of CodeMirror\n\nSee full list of events [here](https://codemirror.net/doc/manual.html#events)\n\n```tsx\nimport { SimpleMdeReact } from \"react-simplemde-editor\";\nimport type { SimpleMdeToCodemirrorEvents } from \"react-simplemde-editor\";\n\nexport const CustomEventListeners = () => {\n  const [value, setValue] = useState(\"Initial value\");\n\n  const onChange = useCallback((value: string) => {\n    setValue(value);\n  }, []);\n\n  // Make sure to always `useMemo` all the `options` and `events` props to ensure best performance!\n  const events = useMemo(() => {\n    return {\n      focus: () => console.log(value),\n    } as SimpleMdeToCodemirrorEvents;\n  }, []);\n\n  return <SimpleMdeReact events={events} value={value} onChange={onChange} />;\n};\n```\n\n### Autosaving\n\n```tsx\nexport const Autosaving = () => {\n  const delay = 1000;\n  const autosavedValue = localStorage.getItem(`smde_demo`) || \"Initial value\";\n  const anOptions = useMemo(() => {\n    return {\n      autosave: {\n        enabled: true,\n        uniqueId: \"demo\",\n        delay,\n      },\n    };\n  }, [delay]);\n\n  return (\n    <SimpleMdeReact id=\"demo\" value={autosavedValue} options={anOptions} />\n  );\n};\n```\n\n### Retrieve `easymde`, `codemirror` or `cursor` info to be able to manipulate it.\n\n```tsx\nexport const GetDifferentInstances = () => {\n  // simple mde\n  const [simpleMdeInstance, setMdeInstance] = useState<SimpleMDE | null>(null);\n\n  const getMdeInstanceCallback = useCallback((simpleMde: SimpleMDE) => {\n    setMdeInstance(simpleMde);\n  }, []);\n\n  useEffect(() => {\n    simpleMdeInstance &&\n      console.info(\"Hey I'm editor instance!\", simpleMdeInstance);\n  }, [simpleMdeInstance]);\n\n  // codemirror\n  const [codemirrorInstance, setCodemirrorInstance] = useState<Editor | null>(\n    null\n  );\n  const getCmInstanceCallback = useCallback((editor: Editor) => {\n    setCodemirrorInstance(editor);\n  }, []);\n\n  useEffect(() => {\n    codemirrorInstance &&\n      console.info(\"Hey I'm codemirror instance!\", codemirrorInstance);\n  }, [codemirrorInstance]);\n\n  // line and cursor\n  const [lineAndCursor, setLineAndCursor] = useState<Position | null>(null);\n\n  const getLineAndCursorCallback = useCallback((position: Position) => {\n    setLineAndCursor(position);\n  }, []);\n\n  useEffect(() => {\n    lineAndCursor &&\n      console.info(\"Hey I'm line and cursor info!\", lineAndCursor);\n  }, [lineAndCursor]);\n\n  return (\n    <div>\n      <h4>Getting instance of Mde and codemirror and line and cursor info</h4>\n      <SimpleMdeReact\n        value=\"Go to console to see stuff logged\"\n        getMdeInstance={getMdeInstanceCallback}\n        getCodemirrorInstance={getCmInstanceCallback}\n        getLineAndCursor={getLineAndCursorCallback}\n      />\n    </div>\n  );\n};\n```\n\n### Basic testing\n\nHere is how you do it. It requires mock of certain browser pieces to work, but this is whole example.\n\n```tsx\nimport { act, render, screen } from \"@testing-library/react\";\nimport { useState } from \"react\";\nimport { SimpleMdeReact } from \"react-simplemde-editor\";\nimport userEvent from \"@testing-library/user-event\";\n\n// @ts-ignore\nDocument.prototype.createRange = function () {\n  return {\n    setEnd: function () {},\n    setStart: function () {},\n    getBoundingClientRect: function () {\n      return { right: 0 };\n    },\n    getClientRects: function () {\n      return {\n        length: 0,\n        left: 0,\n        right: 0,\n      };\n    },\n  };\n};\n\nconst Editor = () => {\n  const [value, setValue] = useState(\"\");\n  return <SimpleMdeReact value={value} onChange={setValue} />;\n};\n\ndescribe(\"Renders\", () => {\n  it(\"succesfully\", async () => {\n    act(() => {\n      render(<Editor />);\n    });\n    const editor = await screen.findByRole(\"textbox\");\n    userEvent.type(editor, \"hello\");\n    expect(screen.getByText(\"hello\")).toBeDefined();\n  });\n});\n```\n\n## API\n\n### Props\n\n```tsx\nexport interface SimpleMDEReactProps\n  extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n  id?: string;\n  onChange?: (value: string, changeObject?: EditorChange) => void;\n  value?: string;\n  extraKeys?: KeyMap;\n  options?: SimpleMDE.Options;\n  events?: SimpleMdeToCodemirrorEvents;\n  getMdeInstance?: GetMdeInstance;\n  getCodemirrorInstance?: GetCodemirrorInstance;\n  getLineAndCursor?: GetLineAndCursor;\n  placeholder?: string;\n  textareaProps?: Omit<\n    React.HTMLAttributes<HTMLTextAreaElement>,\n    \"id\" | \"style\" | \"placeholder\"\n  >;\n}\n```\n\n### All exports list\n\n`default` - SimpleMdeReact <br><br>\n`SimpleMdeReact` - same as `default` but named<br><br>\n**Types:** <br><br>\n`SimpleMdeReactProps` - props of the component <br><br>\n`DOMEvent` - certain events that are used to get events exported below <br><br>\n`CopyEvents` - only copy codemirror events <br><br>\n`GlobalEvents` - some other global codemirror events <br><br>\n`DefaultEvent` - default codemirror event handler function <br><br>\n`IndexEventsSignature` - index signature that expects string as key and returns `DefaultEvent` <br><br>\n`SimpleMdeToCodemirrorEvents` - manually crafted events (based off `@types/codemirror@0.0.109` that `easymde` uses internally) +\nall the above merged together into whole mapping between Codemirror event names and actual handlers for\n`events` prop <br><br>\n`GetMdeInstance` - signature of the callback function that retrieves mde instance <br><br>\n`GetCodemirrorInstance` - signature of the callback function that retrieves codemirror instance <br><br>\n`GetLineAndCursor` - signature of the callback function that retrieves line and cursor info <br><br>\n\n## Changelog\n\n## New in v4\n\n- Now uses [EasyMDE (the most fresh SimpleMDE fork)](https://github.com/Ionaru/easy-markdown-editor)\n  instead of `simplemde` itself. Possible breaking changes, so I bumped version to v4.\n- One obvious breaking change. Is how CSS is have to be imported. It used to be `simplemde/dist/simplemde.min.css` now it will be `easymde/dist/easymde.min.css`\n\n## New in v3\n\n- The `initialValue` prop has been removed and replaced with a `value` prop, allowing direct changes to the value to be made after the component mounts.\n- v3.6.8 if rendering server-side, you can set static ids to avoid errors in rendering synchronization.\n- v3.6.17 TypeScript typings added.\n- v3.6.19 All props will be passed to the wrapper now (except a id, onChange and few others that are ignored)\n- v3.6.21 React 17 support (UNSAFE methods are no longer used)\n\n## New in v2\n\nVersion 1.0 did not have SimpleMDE options configured well, this readme reflects the changes made to better include options.\nThis is still a very new project. Testing, feedback and PRs are welcome and appreciated.\n\n[npm-badge]: http://badge.fury.io/js/react-simplemde-editor.svg\n[npm]: http://badge.fury.io/js/react-simplemde-editor\n","readmeFilename":"README.md"}