2 ms·
For react hooks: the base results are decent, for that particular search phrase. You won't go wrong with the reactjs docs, prominently placed there. https://re
by julianeon 6y ago
For react hooks: the base results are decent, for that particular search phrase. You won't go wrong with the reactjs docs, prominently placed there.
https://reactjs.org/docs/hooks-intro.html https://reactjs.org/docs/hooks-intro.html
For react hooks typescript: sorry, I can't. This is a pretty good example of the problem, because I just searched Google's first page of results for react hooks typescript tutuorial, and they were all bad.
3 of very top results seemed to be a derivative of each other, where they presented a list of concepts, which is not really relevant in teaching you to use them.
Some of the other ones were a very slight improvement, but still not good enough that I'd feel very comfortable recommending them.
On the 1st 2 pages of results, this was the best result I found for react and typescript (not hooks), which at least addresses the topic directly with relevant code.
https://www.educative.io/blog/react-and-typescript https://www.educative.io/blog/react-and-typescript
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!
https://blog.usejournal.com/using-react-hooks-with-typescript-aae6c7b2a3a9 https://blog.usejournal.com/using-react-hooks-with-typescrip...
Anyway, this nicely illustrates the problem. I may try to write a tutorial on this myself, after seeing how bad these are. But for now, this is what's out there.
- acemarke 6y agoThere is an excellent community resource on using React with TypeScript here: https://github.com/typescript-cheatsheets/react-typescript-cheatsheet https://github.com/typescript-cheatsheets/react-typescript-c...
- julianeon 6y agoThank you! Much better answer - I'd now recommend this.
- 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)