Open2

実装Memo(TypeScript)

chocolatchocolat

型を組み合わせる

interface SomeProps {
    some: string;
    other: number;
};

function OfficeSection({
    some,
    other,
    additional,
}: SomeProps & { additional: boolean }): ReactElement {
    return (
        <> ... </>
    );
}
chocolatchocolat

read only

as const と宣言するとread onlyとして扱われる

const someThing = {
  name: "John",
  age: 35
} as const;