【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.08.23 19:08
2026.11.26 6:10
2026.11.26 15:27
2026.11.28 14:00

コメント一覧

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

コメント