How to use a Set data structure as a state in React Typescript?
I want to initialize a React state as an empty Set in Typescript, and then add/remove values. If I wanted to use an array, I would do this: const [products, setProducts] = React.useState<String[]>([]) // And then to change it: setProducts([…products, "new product"]) But I want to use a Set, so every value has to be… Read More How to use a Set data structure as a state in React Typescript?