useStateAsArray react hook
A React Hook to create multiple react useState
states as an array.
Installation
$ yarn add use-state-as-array
Import
import useStateAsArray from 'use-state-as-array';
Usage
const [stateAsArray, setStateAsArray] = useStateAsArray(['first', 'second'])
setStateAsArray(0, 'new value')