I've made the mistake multiple times where I forget to return a JSX from a functional component. That is, I do something like the following:
const Hello = function Hello({name}) {
<div>Hello {name}</div>
}
Instead of
const Hello = function Hello({name}) {
return <div>Hello {name}</div>
}
I totally know why it's wrong, but I often conflate the the ES6 syntax that does not need a return mentioned with this.
Is there any help TypeScript can give me so I see it as an error before I run it and get the error saying a return is likely missing?
Here is a stackblitz of the problem:
https://stackblitz.com/edit/react-ts-badreturn?file=Hello.tsx