import React from 'react' import { useEditor, EditorContent } from '@tiptap/react' import Document from '@tiptap/extension-document' import Paragraph from '@tiptap/extension-paragraph' import Text from '@tiptap/extension-text' import Heading from '@tiptap/extension-heading' export default () => { const editor = useEditor({ extensions: [ Document, Paragraph, Text, Heading.configure({ levels: [1, 2, 3], }), ], content: `

This is a 1st level heading

This is a 2nd level heading

This is a 3rd level heading

This 4th level heading will be converted to a paragraph, because levels are configured to be only 1, 2 or 3.

`, }) if (!editor) { return null } return ( <> ) }