react-flow-chart icon indicating copy to clipboard operation
react-flow-chart copied to clipboard

did not get updated chart value in "onLinkMove" function after updating chart in "onLinkStart" function. Please check my code

Open Aman8756 opened this issue 5 years ago • 0 comments

export const onLinkStart = ({ linkId, fromNodeId, fromPortId }, chart, campaign_id, setChart) => { const newChart = cloneDeep(chart); newChart.links[linkId] = { id: linkId, from: { nodeId: fromNodeId, portId: fromPortId, }, to: {}, }; setChart({ chart: newChart }); };

export const onLinkMove = ({ linkId, toPosition }, chart, campaign_id, setChart) => { const newChart = cloneDeep(chart); // This chart is not updated one. So, it did not find the linkId. const link = newChart.links[linkId]; link.to.position = toPosition; newChart.links[linkId] = { ...link }; setChart({ chart: newChart }); };

Aman8756 avatar May 25 '20 08:05 Aman8756