set a type with useState react typescript 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[]>([]);