usestate with function type code example Example: type usestate([]) const [products, setProducts] = useState<Props[]>([]);