エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Passing Generics to JSX Elements in TypeScript
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Passing Generics to JSX Elements in TypeScript
TypeScript 2.9 added the ability to specify type arguments for generic JSX elements. This means w... TypeScript 2.9 added the ability to specify type arguments for generic JSX elements. This means we can now write the following component in a TSX file: function Form() { // ... return ( <Select<string> options={targets} value={target} onChange={setTarget} /> ); } To understand why it's useful to have generic JSX elements (and why we typically don't have to write out the type argument explicitly),