GraphProvider component creates a graph instance and provide dia.graph to it's children. It relies on
dia.graph
{GraphProvider} props
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>) Copy
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>) Copy
import { GraphProvider } from '@joint/react'function App() { return ( <GraphProvider initialElements={[]} initialLinks={[]}> <MyApp /> </GraphProvider>)
GraphProvider component creates a graph instance and provide
dia.graph
to it's children. It relies on