typescript create type for useState code example
Example 1: type usestate typescript
interface Provider {
connected: boolean;
type: string;
}
const [wearablesList, setWearablesList] = useState<Provider[]>([]);
Example 2: type usestate([])
const [products, setProducts] = useState<Props[]>([]);