Skip to main content

DiagramProvider

DiagramProvider(props): Element

Provider for a Diagram. You can use this at some high level in your UI - some common parent component between the parent of where you want to put a Diagram and where you want to put some other component such as miniview, controls or DiagramPalette . Whenever a DiagramComponent is declared as a descendant of this provider, the provider's underlying diagram is set and this is propagated to all the other components using this context. To use this you just declare a DiagramProvider element and put some children inside of it:

<DiagramProvider>
<DiagramComponent options={...}/>
<DiagramPalette/>
</DiagramProvider>

Parameters

props

children?

ReactNode | ReactElement<any, any> | ReactNode | ReactElement<any, any>[]

Returns

Element