Refactor interactivity demos

This commit is contained in:
svenadlung
2021-11-22 20:48:04 +01:00
parent bdb055187a
commit d434675f74
19 changed files with 6 additions and 6 deletions

View File

@@ -0,0 +1,22 @@
import React from 'react'
import { NodeViewWrapper } from '@tiptap/react'
export default props => {
const increase = () => {
props.updateAttributes({
count: props.node.attrs.count + 1,
})
}
return (
<NodeViewWrapper className="react-component">
<span className="label">React Component</span>
<div className="content">
<button onClick={increase}>
This button has been clicked {props.node.attrs.count} times.
</button>
</div>
</NodeViewWrapper>
)
}