Skip to content

Commit

Permalink
Merge pull request #13 from sroussey/main
Browse files Browse the repository at this point in the history
No need for two ReactFlowProvider
  • Loading branch information
clarkmcc authored Jan 26, 2024
2 parents 7fefe87 + e4e947c commit e9912a7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
8 changes: 3 additions & 5 deletions lib/NodeGraphEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ export const ExampleNodeGraphEditor = forwardRef<
const config = useBuildGraphConfig(_config)
return (
<GraphConfigProvider defaultConfig={config}>
<ReactFlowProvider>
<NodeGraphEditor ref={ref} defaultNodes={nodes} defaultEdges={edges}>
<Background color="#52525b" variant={BackgroundVariant.Dots} />
</NodeGraphEditor>
</ReactFlowProvider>
<NodeGraphEditor ref={ref} defaultNodes={nodes} defaultEdges={edges}>
<Background color="#52525b" variant={BackgroundVariant.Dots} />
</NodeGraphEditor>
</GraphConfigProvider>
)
})
Expand Down
9 changes: 3 additions & 6 deletions lib/NodeGraphEditorCustomInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
BackgroundVariant,
Edge,
Node,
ReactFlowProvider,
} from '@xyflow/react'
import { useBuildGraphConfig } from './hooks/config.ts'
import { NodeInputField } from './components/NodeInputField.tsx'
Expand Down Expand Up @@ -73,11 +72,9 @@ const meta = {
)
return (
<GraphConfigProvider defaultConfig={config}>
<ReactFlowProvider>
<NodeGraphEditor defaultNodes={nodes} defaultEdges={edges}>
<Background color="#52525b" variant={BackgroundVariant.Dots} />
</NodeGraphEditor>
</ReactFlowProvider>
<NodeGraphEditor defaultNodes={nodes} defaultEdges={edges}>
<Background color="#52525b" variant={BackgroundVariant.Dots} />
</NodeGraphEditor>
</GraphConfigProvider>
)
},
Expand Down
9 changes: 3 additions & 6 deletions lib/NodeGraphEditorCustomNode.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Edge,
Node,
Position,
ReactFlowProvider,
} from '@xyflow/react'
import { NodeContainer } from './components/NodeContainer'
import { useFocusBlur } from './hooks/focus'
Expand Down Expand Up @@ -71,11 +70,9 @@ const meta = {
}, [])
return (
<GraphConfigProvider defaultConfig={config}>
<ReactFlowProvider>
<NodeGraphEditor defaultNodes={nodes} defaultEdges={edges}>
<Background color="#52525b" variant={BackgroundVariant.Dots} />
</NodeGraphEditor>
</ReactFlowProvider>
<NodeGraphEditor defaultNodes={nodes} defaultEdges={edges}>
<Background color="#52525b" variant={BackgroundVariant.Dots} />
</NodeGraphEditor>
</GraphConfigProvider>
)
},
Expand Down
9 changes: 3 additions & 6 deletions lib/NodeGraphEditorInputGroups.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
BackgroundVariant,
Edge,
Node,
ReactFlowProvider,
} from '@xyflow/react'
import { useBuildGraphConfig } from './hooks/config.ts'
import { InputProps } from './config.ts'
Expand Down Expand Up @@ -202,11 +201,9 @@ const meta = {
)
return (
<GraphConfigProvider defaultConfig={config}>
<ReactFlowProvider>
<NodeGraphEditor defaultNodes={nodes} defaultEdges={edges}>
<Background color="#52525b" variant={BackgroundVariant.Dots} />
</NodeGraphEditor>
</ReactFlowProvider>
<NodeGraphEditor defaultNodes={nodes} defaultEdges={edges}>
<Background color="#52525b" variant={BackgroundVariant.Dots} />
</NodeGraphEditor>
</GraphConfigProvider>
)
},
Expand Down

0 comments on commit e9912a7

Please sign in to comment.