const id = itemToBeReplaced.id 
const updatedData = arr.map(item => (item.id === id ? { ...item, props: 'some value to be replaced' } : item));