0.0.5 • Published 1 month ago

poor-editor v0.0.5

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

Demo

export default function App() {
  const ref = useRef<PoorEditorHandler>(null)
  
  const onClick = () => {
    const html = ref.current?.getHTML()
    alert(html)
  }

  return (
    <main>
      <PoorEditor ref={ref}
        showHTML={false}
        showJSON={false}
        initContent={'hello world'}
      />
      <button onClick={onClick}>HTML</button>
    </main>
  )
}

Type

type PoorEditorHandler = {
  getHTML: getHTML: () => string;
}

type PoorEditorProps = {
  initContent?: string;
  showHTML?: boolean;
  showJSON?: boolean;
}

Dependencies