11/* eslint-disable react/jsx-props-no-spreading */
22/* eslint-disable @typescript-eslint/explicit-function-return-type */
33import React , { FC , ComponentProps } from 'react' ;
4- import { Context } from 'ts-graphviz' ;
4+
55import { Digraph } from '../../../components/Digraph' ;
66import { Graph } from '../../../components/Graph' ;
77import { GraphvizContext } from '../../../components/contexts/GraphvizContext' ;
88import { Subgraph } from '../../../components/Subgraph' ;
99
1010export const context = ( ) : FC => ( { children } ) => {
11- const ctx = new Context ( ) ;
12- return < GraphvizContext . Provider value = { ctx } > { children } </ GraphvizContext . Provider > ;
11+ return < GraphvizContext . Provider value = { { } } > { children } </ GraphvizContext . Provider > ;
1312} ;
1413
1514export const digraph = ( props : ComponentProps < typeof Digraph > = { } ) : FC => ( { children } ) => {
16- const ctx = new Context ( ) ;
1715 return (
18- < GraphvizContext . Provider value = { ctx } >
16+ < GraphvizContext . Provider value = { { } } >
1917 < Digraph { ...props } > { children } </ Digraph >
2018 </ GraphvizContext . Provider >
2119 ) ;
2220} ;
2321
2422export const digraphInSubgraph = ( props : ComponentProps < typeof Subgraph > = { } ) : FC => ( { children } ) => {
25- const ctx = new Context ( ) ;
2623 return (
27- < GraphvizContext . Provider value = { ctx } >
24+ < GraphvizContext . Provider value = { { } } >
2825 < Digraph >
2926 < Subgraph { ...props } > { children } </ Subgraph >
3027 </ Digraph >
@@ -33,18 +30,16 @@ export const digraphInSubgraph = (props: ComponentProps<typeof Subgraph> = {}):
3330} ;
3431
3532export const graph = ( props : ComponentProps < typeof Graph > = { } ) : FC => ( { children } ) => {
36- const ctx = new Context ( ) ;
3733 return (
38- < GraphvizContext . Provider value = { ctx } >
34+ < GraphvizContext . Provider value = { { } } >
3935 < Graph { ...props } > { children } </ Graph >
4036 </ GraphvizContext . Provider >
4137 ) ;
4238} ;
4339
4440export const graphInSubgraph = ( props : ComponentProps < typeof Subgraph > = { } ) : FC => ( { children } ) => {
45- const ctx = new Context ( ) ;
4641 return (
47- < GraphvizContext . Provider value = { ctx } >
42+ < GraphvizContext . Provider value = { { } } >
4843 < Graph >
4944 < Subgraph { ...props } > { children } </ Subgraph >
5045 </ Graph >
0 commit comments