Closed NWYLZW closed 12 months ago
If my target value type is function, it can't debounced which be used as state init function.
const func: ((a: boolean) => string) | undefined = useMemo(() => xxx, []) const a = useDebouncedValue(func, 100)
And if I want to set state init value, it unable infer right type.
const a = useDebouncedValue(() => 1, 100) // a type: () => number
But a real value is number.
a
Close as won't merge.
You should never debounce a function as a value itself.
If my target value type is function, it can't debounced which be used as state init function.
And if I want to set state init value, it unable infer right type.
But
a
real value is number.