Let's say we want to make Hook with type string[], and no elements. I am doing
const def: string[] = []
const [selected, setSelected] = useState(def);
Which works. But, I was wondering if there is a way to achieve this in one line only.
Let's say we want to make Hook with type string[], and no elements. I am doing
const def: string[] = []
const [selected, setSelected] = useState(def);
Which works. But, I was wondering if there is a way to achieve this in one line only.