-通过 / -执行
When array is used in React state, we need to deal with actions such as push and remove.
push
remove
Implement useArray() to make life easier.
useArray()
const {value, push, removeByIndex} = useArray([1, 2, 3])
普通解法但是bugfree胜于奇技淫巧但是各种bug。
Try it out
Console