* chore: add precommit hook for eslint fixes, fix linting issues * chore: add eslint import sort plugin
23 lines
524 B
JavaScript
23 lines
524 B
JavaScript
import { NodeViewWrapper } from '@tiptap/react'
|
|
import React from '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>
|
|
)
|
|
}
|