@Denis93

Как сделать редактируемый блок в slate.js?

<script>
// Import React dependencies.
import React, { useState } from 'react'
// Import the Slate editor factory.
import { createEditor } from 'slate'

// Import the Slate components and React plugin.
import { Slate, Editable, withReact } from 'slate-react'

const initialValue = [
  {
    type: 'paragraph',
    children: [{ text: 'A line of text in a paragraph.' }],
  },
]

const App = () => {
  const [editor] = useState(() => withReact(createEditor()))
  return (
    // Add the editable component inside the context.
    <Slate editor={editor} initialValue={initialValue}>
      <Editable />
    </Slate>
  )
}


  </script>

делаю вот такой код из документации но не работает(
(react подключал с unpkg.com не ставил на сам сервер )
у кого то есть опыт с salte.js? можете помочь кто нибудь?
нужно просто сделать редактируемый блок как тут на скрине
65b8bcde2d76d553594331.png
  • Вопрос задан
  • 85 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы