3 ms·
> Also I want to call out this example for being especially ridiculous, because it titles itself as "Using React Hooks with Typescript" and then doesn't actuall
by mikewhy 6y ago
> Also I want to call out this example for being especially ridiculous, because it titles itself as "Using React Hooks with Typescript" and then doesn't actually use any Typescript!
That is all 100% valid, fully typed TypeScript
TypeScript's inference is smart enough to know that ...
const [count, setCount] = useState(0)
... is the same as ...
const [count, setCount] = useState<number>(0)