1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 14:34:19 +00:00

🐛 Fix possible bug in useArrayState

This commit is contained in:
Stefano Pigozzi 2021-05-11 23:44:14 +02:00
parent 1abf0d0dc9
commit abac554e95
Signed by untrusted user who does not match committer: steffo
GPG key ID: 6965406171929D01

View file

@ -25,9 +25,8 @@ export default function useArrayState(def) {
console.debug("Splicing ", position, " from ArrayState") console.debug("Splicing ", position, " from ArrayState")
setValue( setValue(
oldArray => { oldArray => {
// TODO: Hope this doesn't break anything...
oldArray.splice(position, 1) oldArray.splice(position, 1)
return oldArray return [...oldArray]
}, },
) )
}, },