From 1e12f811398fb17f0df250ee89bc36cc7c3b1542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Huvar?= Date: Thu, 29 Aug 2024 11:26:23 +0200 Subject: [PATCH] fix(virtual-core): add bigint to Key to align with @types/react implementation (#814) --- docs/api/virtual-item.md | 4 ++-- packages/virtual-core/src/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api/virtual-item.md b/docs/api/virtual-item.md index 9ab47448..2393788b 100644 --- a/docs/api/virtual-item.md +++ b/docs/api/virtual-item.md @@ -6,7 +6,7 @@ The `VirtualItem` object represents a single item returned by the virtualizer. I ```tsx export interface VirtualItem { - key: string | number + key: string | number | bigint index: number start: number end: number @@ -19,7 +19,7 @@ The following properties and methods are available on each VirtualItem object: ### `key` ```tsx -key: string | number +key: string | number | bigint ``` The unique key for the item. By default this is the item index, but should be configured via the `getItemKey` Virtualizer option. diff --git a/packages/virtual-core/src/index.ts b/packages/virtual-core/src/index.ts index 951a33db..99d38478 100644 --- a/packages/virtual-core/src/index.ts +++ b/packages/virtual-core/src/index.ts @@ -26,7 +26,7 @@ export interface Range { count: number } -type Key = number | string +type Key = number | string | bigint export interface VirtualItem { key: Key