Skip to content

Commit

Permalink
chore: remove node transformation in provider setup
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjuning committed Dec 31, 2024
1 parent 3a176fb commit eaed36c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/x-flow/src/hooks/useFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export const useFlow = () => {
screenToFlowPosition,
flowToScreenPosition
} = useReactFlow();
const setNodes = useMemoizedFn((nodes: FlowNode[], isVanilla = true) => {
const setNodes = useMemoizedFn((nodes: FlowNode[], isVanilla = false) => {
storeApi.getState().setNodes(nodes, isVanilla);
});
const addNodes = useMemoizedFn((nodes: FlowNode[], isVanilla = true) => {
const addNodes = useMemoizedFn((nodes: FlowNode[], isVanilla = false) => {
storeApi.getState().addNodes(nodes, isVanilla);
});
const setEdges = useMemoizedFn((edges: Edge[]) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/x-flow/src/models/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const createStore = (initProps?: Partial<FlowProps>) => {
edges: addEdge(connection, get().edges),
});
},
setNodes: (nodes, isVanilla = true) => {
setNodes: (nodes, isVanilla = false) => {
set({ nodes: isVanilla ? nodes : transformNodes(nodes) });
},
getNodes: () => {
Expand All @@ -96,7 +96,7 @@ const createStore = (initProps?: Partial<FlowProps>) => {
getEdges: () => {
return get().nodes;
},
addNodes: (payload, isVanilla = true) => {
addNodes: (payload, isVanilla = false) => {
const newNodes = get().nodes.concat(payload);
set({ nodes: isVanilla ? newNodes : transformNodes(newNodes) });
},
Expand Down

0 comments on commit eaed36c

Please sign in to comment.