Javascript – Continuous data duplication when item is inserted into React js Array state
Data is being duplicated when item is inserted into React js Array state, console.log(newData) outputs a single object, while console.log(data) outputs continuous duplicate of console.log(newData) How do i fix it const [data, setData] = useState([]) const addData = (newData) =>…