refactor defaultNodes/defaultEdges handling (#3882)

* refactor(react): cleanup defaultnodes/defaultedges handling

* chore(examples): cleanup

* chore(examples): cleanup

* fix(react): selection for uncontrolled flows
This commit is contained in:
Moritz Klack
2024-02-07 17:09:39 +01:00
committed by GitHub
parent 76606c67da
commit 6b18c9daeb
10 changed files with 96 additions and 172 deletions
@@ -10,6 +10,8 @@ export function ReactFlowProvider({
children,
initialNodes,
initialEdges,
defaultNodes,
defaultEdges,
initialWidth,
initialHeight,
fitView,
@@ -17,6 +19,8 @@ export function ReactFlowProvider({
children: ReactNode;
initialNodes?: Node[];
initialEdges?: Edge[];
defaultNodes?: Node[];
defaultEdges?: Edge[];
initialWidth?: number;
initialHeight?: number;
fitView?: boolean;
@@ -27,6 +31,8 @@ export function ReactFlowProvider({
storeRef.current = createRFStore({
nodes: initialNodes,
edges: initialEdges,
defaultNodes,
defaultEdges,
width: initialWidth,
height: initialHeight,
fitView,