Hooks
useArray

Import this in your client-side component

MyComponent.tsx
import { useArray } from "react-amazing-hooks";
ApiDescriptionTypeReturn TypeExample
addFunction to add an element to the array.item: Tvoidadd(newItem)
clearFunction to remove all elements from the array.voidvoidclear()
removeByIdFunction to remove an element by its id.id: numbervoidremoveById(1)
removeIndexFunction to remove an element by index.index: numbervoidremoveIndex(0)
replaceAtIndexFunction to replace an element at a specific index.index: number, newItem: TvoidreplaceAtIndex(0, newItem)
replaceByIdFunction to replace an element by its id.id: number, newItem: TvoidreplaceById(1, newItem)
shuffleFunction to shuffle the array randomly.voidvoidshuffle()
ascendingSortFunction to sort the array in ascending order.voidvoidascendingSort()
descendingSortFunction to sort the array in descending order.voidvoiddescendingSort()

Check the UseArrayReturn and HasId in the 'Types' tab.