@knitui/hooks
useListState
Manage array state with a rich set of immutable handlers — port of Mantine's useListState. Every handler returns a new array, so the state is safe to use as a dependency / memo input. Pure React, so identical on web and native.
WebiOSAndroidtested
Import
import { useListState } from "@knitui/hooks";Signature
export function useListState<T>(initialValue: T[] = []): UseListStateReturn<T>Exported types: UseListStateHandlers, UseListStateReturn