Refactor interactivity demos
This commit is contained in:
27
demos/src/Examples/InteractivityComponent/React/index.jsx
Normal file
27
demos/src/Examples/InteractivityComponent/React/index.jsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from 'react'
|
||||
import { useEditor, EditorContent } from '@tiptap/react'
|
||||
import StarterKit from '@tiptap/starter-kit'
|
||||
import ReactComponent from './Extension.js'
|
||||
import './styles.scss'
|
||||
|
||||
export default () => {
|
||||
const editor = useEditor({
|
||||
extensions: [
|
||||
StarterKit,
|
||||
ReactComponent,
|
||||
],
|
||||
content: `
|
||||
<p>
|
||||
This is still the text editor you’re used to, but enriched with node views.
|
||||
</p>
|
||||
<react-component count="0"></react-component>
|
||||
<p>
|
||||
Did you see that? That’s a React component. We are really living in the future.
|
||||
</p>
|
||||
`,
|
||||
})
|
||||
|
||||
return (
|
||||
<EditorContent editor={editor} />
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user