【TypeScript】値・型・名前空間の「三重定義」でReactコンポーネントをより柔軟に設計する

2026.05.17 2:12
Zenn.dev

export type Rectangle = { height: number; width: number; }; export const Rectangle = { from(height: number, width: number): Rectangle { return { height, width, }; }, }; // Rectangleという宣言が型と値の両方で使える! const rectangle: Rectangle = Rectangle.from(1, 3); サバイバルType…

検索

人気記事

2026.05.05 11:04
2026.09.26 10:35
2026.09.27 0:04
2026.09.25 22:15
2026.09.27 2:16

コメント一覧

まだコメントはありません。

コメント