Open silverwind opened 2 months ago
You could do it with [] as const
, but it could be nice to have a type for this too, for discoverability.
We already have https://github.com/sindresorhus/type-fest/blob/main/source/non-empty-tuple.d.ts
Yeah I guess this type would mostly be for completeness sake. I guess EmptyObject
has a reason for existence because of the mentioned problems surrounding the {}
type that []
hopefully doesn't have.
There is
EmptyObject
, and I think aEmptyArray
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:
Upvote & Fund