The returned snapshot is read-only. Don’t mutate it. Copy before editing: const editable = structuredClone(snap) (deep) or const editable = { ...snap } (shallow).
const editable = structuredClone(snap)
const editable = { ...snap }
Remarks
The returned snapshot is read-only. Don’t mutate it. Copy before editing:
const editable = structuredClone(snap)(deep) orconst editable = { ...snap }(shallow).