score:2

                         onRowUpdate: (newData, oldData) =>
                         new Promise((resolve, reject) => {
                             setTimeout(() => {
                               let clone = [];
                               Object.assign(clone, this.state.data);
                               console.log("clone1:", clone);
                               const index = this.state.data.indexOf(oldData);
                               clone[index] = newData;
                               this.setState({ data:clone }, () => {
                                 resolve();
                               });
                             }, 1000);
                           }),

score:3

const [data, setData] = useState([]);
...

setData(prevData => [...prevData, newData])

Related Query

More Query from same tag