0

`

if (sInd === dInd) {
        const reorderCardItems = reorderCard(items[sInd], source.index, destination.index);
       const newState = [...items];
        newState[sInd].card = reorderCardItems;
        seState({newState: newState});

`

if (sInd === dInd) {
        const reorderCardItems = reorderCard(items[sInd], source.index, destination.index);
        let newState = [...items];
        newState[sInd].card = reorderCardItems;
        newState= newState;

it's giving me error that 'newState' is assigned to itself.

0 Answers0