Hey, while in your example it makes sense to give the component an implicit children prop, in the article above it might be misleading. Someone could be using something like
<Formstate={state}setState={setState}handleOnSubmit={handleOnSubmit}placeholder="Type some letters">Someinfotext</Form>
and wondering why the text is not rendering without TypeScript complaining. You could instead write it like
and do not lose something too useful. I stumbled upon github.com/typescript-cheatsheets/... (Why is React.FC discouraged?) a while ago and thought it could be useful to share here.
Hey, while in your example it makes sense to give the component an implicit children prop, in the article above it might be misleading. Someone could be using something like
and wondering why the text is not rendering without TypeScript complaining. You could instead write it like
and do not lose something too useful. I stumbled upon github.com/typescript-cheatsheets/... (Why is
React.FC
discouraged?) a while ago and thought it could be useful to share here.Thanks for sharing! Undoubtedly a good resource to study. 🤓