Skip to content

Latest commit

 

History

History
42 lines (22 loc) · 1.39 KB

useArray.md

File metadata and controls

42 lines (22 loc) · 1.39 KB

realueDocs


realue / useArray

Function: useArray()

useArray<A, G, T, E>(props, itemId): ItemCallable<T, E>

Takes an array and returns a function that generates the required props for handling an array item value. That function also contains three callables: loop, add, and remove.

Type Parameters

A extends undefined | readonly any[]

G extends ErrorReportArray<NonNullable<A>>

T = NonNullable<A> extends readonly H[] ? H : never

E extends ErrorReportArray<any> = ErrorReport<T>

Parameters

props: NevoProps<A, G>

Properties according to the NEVO pattern, where the value holds an array.

itemId: ItemId<T> = itemIdDefault

An optional function that returns a unique identifier for a given array item.

Returns

ItemCallable<T, E>

The item function that returns the props for a specific item index.

Defined in

lib/hooks/useArray.ts:32