MCPcopy Index your code
hub / github.com/streamich/react-use / getHook

Function getHook

tests/useList.test.ts:10–19  ·  view source on GitHub ↗
(initialArray?: T[])

Source from the content-addressed store, hash-verified

8 });
9
10 function getHook<T>(initialArray?: T[]) {
11 return renderHook(
12 (props): [number, [T[], ListActions<T>]] => {
13 const counter = useRef(0);
14
15 return [++counter.current, useList(props)];
16 },
17 { initialProps: initialArray }
18 );
19 }
20
21 it('should init with 1st parameter and actions', () => {
22 const hook = getHook([1, 2, 3]);

Callers 1

useList.test.tsFile · 0.70

Calls 1

useListFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…