typescript-cheatsheets / react

Cheatsheets for experienced React developers getting started with TypeScript

Home Page:https://react-typescript-cheatsheet.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Advanced] Children typing section is outdated

scvsoft-javierrotelli opened this issue · comments

What cheatsheet is this about? (if applicable)

Advanced cheatsheet

What's your issue or idea?
since TS 2.3 it is posible to type children components, making the following section outdated:
https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_usecase/#typing-children

Thanks for the great site :D

I don't understand how the linked TS page contradicts the cheatsheet page. They both say you can restrict to a single element or a tuple. Neither claim you can declare what component e.g. "my component only accepts two <div /> but not two <span />".

Could you create TypeScript playground that illustrates what is now possible that the cheatsheet claims isn't?

Hi! as it turns out. I've misread things here. the cheatsheet is right. sorry for the confusion, and thanks for your time