1.0.7 • Published 2 years ago

tiptap-react-utils v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

tiptap-react-utils

Here's a sample use of this lib:

    import { Node, NodeViewWrapper } from "@tiptap/react"
    import {getBasicNodeConfiguration, NodeProps} from "tiptap-react-utils"

    class SuperAttributes {
      count: number = 0
    }

    function Super(props: NodeProps<SuperAttributes>) {
      const increase = () => {
        props.updateAttributes({
          count: props.node.attrs.count + 1
        })
      }
      return (
        <NodeViewWrapper>
          <span> {props.node.attrs.count } </span>
          <button onClick={increase}>Increase</button>
        </NodeViewWrapper>
      )
    }


    const SuperNode = Node.create({
      ...getBasicNodeConfiguration("super-node", Super, SuperAttributes),
    })

    export default SuperNode
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago