Check out example codes for "using es6 set in typescript". It will help you in understanding the concepts better.

Code Example 1

const [elements, setElements] = useState<Set<string>>(new Set())

Learn ReactJs, React Native from akashmittal.com