use-list
v4.7.0arrow_drop_downv4.7.0
STATUS
Passing
DOWNLOADS
23
VISIBILITY
Public
PUBLISHED
6 years ago
SIZE
N/A
1 contributor
Like
Install use-list as a package?
Copied
npm i @bit/giladshoham.react-hooks.use.use-list
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
chevron_left
chevron_right
useList
React state hook that tracks a value of an array.
Usage
import {useList} from 'react-use';
const Demo = () => {
const [list, {set, push}] = useList();
return (
<div>
<div>{list.join(',')}</div>
<button onClick={() => set([])}>Reset</button>
<button onClick={() => push(Date.now())}>Push</button>
</div>
);
};