-通过 / -执行
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])
始终思考更好的解决办法
Try it out
Console