【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.17 0:00
2026.05.17 2:12
2026.05.17 0:00
2026.05.16 21:07
2026.05.17 6:05

コメント一覧

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

コメント