0

I would try to do a react-sortable-tree Crud Operation. I have Too much Struggle to update Data after Editing. Kindly anyone clarifies my issues. I would attach my code sandbox live link below.

https://codesandbox.io/s/zealous-browser-06fqg?file=/src/App.js

Annath Raj
  • 11
  • 1

1 Answers1

0
  //Update node
  const updateNode = (rowInfo, data) => {
    // console.log(data, "data")
    console.log(numbers, "array position");
    console.log(path, "path position");
    console.log(rowInfo, "rowInfo value");
    var treeIndex = numbers;
    var paths = path;
    console.log(treeIndex, "treeIndex position");
    if (action === "edit") {
      treeData[treeIndex].title = rowInfo;
      settreeData([...treeData]);
      setaction("add");
    } else {
      settreeData([...treeData, { title: rowInfo }]);
      alert("hello");
      setaction("add");
    }
  };
Or Assayag
  • 5,662
  • 13
  • 57
  • 93