1.0.7 • Published 3 years ago

tiptap-react-utils v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 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

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago