How to use the slate-react.useEditor function in slate-react

To help you get started, we’ve selected a few slate-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ianstormtaylor / slate / site / examples / check-lists.js View on Github external
const CheckListItemElement = ({ attributes, children, element }) => {
  const editor = useEditor()
  const readOnly = useReadOnly()
  const { checked } = element
  return (
    <div>
      </div>
github ianstormtaylor / slate / site / examples / embeds.js View on Github external
const VideoElement = ({ attributes, children, element }) =&gt; {
  const editor = useEditor()
  const selected = useSelected()
  const focused = useFocused()
  const { url } = element
  return (
    <div>
      <div selected="" style="{{">
        </div></div>
github ianstormtaylor / slate / site / examples / images.js View on Github external
const InsertImageButton = () =&gt; {
  const editor = useEditor()
  return (
    <button> {
        event.preventDefault()
        const url = window.prompt('Enter the URL of the image:')
        if (!url) return
        insertImage(editor, url)
      }}
    &gt;
      image
    </button>
  )
}