sindresorhus/type-fest

`EmptyArray` type

オープン

#929 opened on 2024/08/06

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (471 件のフォーク)batch import
help wantedtype addition

Repository metrics

Stars
 (12,328 個のスター)
PR merge metrics
 (平均マージ 3d 5h) (30d で 11 merged PRs)

説明

There is EmptyObject, and I think a EmptyArray type for a strictly empty array would be useful.

One use case of empty array with React to avoid re-renders because of unstable default prop:

const defaultArr = [];
const Component = ({arr = defaultArr}) => arr.join(",");

コントリビューターガイド