react ts useState code example
Example 1: useStae with array of strings typescript
const [devices, setDevices] = useState<string[]>([])
Example 2: type usestate typescript
interface Provider {
connected: boolean;
type: string;
}
const [wearablesList, setWearablesList] = useState<Provider[]>([]);
Example 3: type usestate([])
const [products, setProducts] = useState<Props[]>([]);