【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
2025.07.06 13:46
2025.07.04 14:21
2026.07.28 11:00
2025.09.22 14:20

コメント一覧

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

コメント