@joint/react
    Preparing search index...

    Function GraphProvider

    • GraphProvider component creates a graph instance and provide dia.graph to it's children. It relies on

      Parameters

      Returns null | Element

      GraphProvider component

      useCreateGraphStore hook to create the graph instance.

      Without this provider, the library will not work.

      Using provider:

      import { GraphProvider } from '@joint/react'

      function App() {
      return (
      <GraphProvider>
      <MyApp />
      </GraphProvider>
      )

      Using provider with default elements and links:

      import { GraphProvider } from '@joint/react'

      function App() {
      return (
      <GraphProvider initialElements={[]} initialLinks={[]}>
      <MyApp />
      </GraphProvider>
      )