From eb01295c5152224d89d00a706500dcc11cfede77 Mon Sep 17 00:00:00 2001 From: Alex Vipond Date: Wed, 29 Apr 2026 20:22:45 -0500 Subject: [PATCH] export Virtualizer from react-aria --- packages/react-aria/exports/Virtualizer.ts | 13 +++++++++++++ packages/react-aria/exports/index.ts | 2 ++ packages/react-aria/src/virtualizer/Virtualizer.tsx | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 packages/react-aria/exports/Virtualizer.ts diff --git a/packages/react-aria/exports/Virtualizer.ts b/packages/react-aria/exports/Virtualizer.ts new file mode 100644 index 00000000000..dea0d6a5a2b --- /dev/null +++ b/packages/react-aria/exports/Virtualizer.ts @@ -0,0 +1,13 @@ +/* + * Copyright 2020 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +export {Virtualizer} from '../src/virtualizer/Virtualizer'; +export type {VirtualizerProps} from '../src/virtualizer/Virtualizer'; diff --git a/packages/react-aria/exports/index.ts b/packages/react-aria/exports/index.ts index df912dc0725..148c812d138 100644 --- a/packages/react-aria/exports/index.ts +++ b/packages/react-aria/exports/index.ts @@ -140,6 +140,7 @@ export {mergeRefs} from '../src/utils/mergeRefs'; export {useId} from '../src/utils/useId'; export {useObjectRef} from '../src/utils/useObjectRef'; export {RouterProvider} from '../src/utils/openLink'; +export {Virtualizer} from '../src/virtualizer/Virtualizer'; export {VisuallyHidden, useVisuallyHidden} from '../src/visually-hidden/VisuallyHidden'; export type {AriaAutocompleteProps, AriaAutocompleteOptions, AutocompleteAria, CollectionOptions, InputProps} from '../src/autocomplete/useAutocomplete'; @@ -268,5 +269,6 @@ export type {TooltipTriggerAria} from '../src/tooltip/useTooltipTrigger'; export type {TooltipTriggerProps} from 'react-stately/useTooltipTriggerState'; export type {AriaTreeProps, TreeProps, TreeAria, AriaTreeOptions} from '../src/tree/useTree'; export type {AriaTreeItemOptions, TreeItemAria} from '../src/tree/useTreeItem'; +export type {VirtualizerProps} from '../src/virtualizer/Virtualizer'; export type {VisuallyHiddenAria, VisuallyHiddenProps} from '../src/visually-hidden/VisuallyHidden'; export type {Key, Orientation, RangeValue} from '@react-types/shared'; diff --git a/packages/react-aria/src/virtualizer/Virtualizer.tsx b/packages/react-aria/src/virtualizer/Virtualizer.tsx index 06e0a648da2..f405012a040 100644 --- a/packages/react-aria/src/virtualizer/Virtualizer.tsx +++ b/packages/react-aria/src/virtualizer/Virtualizer.tsx @@ -26,7 +26,7 @@ type RenderWrapper = ( renderChildren: (views: ReusableView[]) => ReactElement[] ) => ReactElement | null; -interface VirtualizerProps extends Omit, 'children' | 'onScroll'> { +export interface VirtualizerProps extends Omit, 'children' | 'onScroll'> { children: (type: string, content: T) => V, renderWrapper?: RenderWrapper, layout: Layout,