-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React 19 support #6437
React 19 support #6437
Conversation
package.json
Outdated
@@ -12,12 +12,12 @@ | |||
"check-types": "tsc && tsc-strict", | |||
"install-16": "yarn add -W react@^16.8.0 react-dom@^16.8.0 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 && node scripts/oldReactSupport.mjs", | |||
"install-17": "yarn add -W react@^17 react-dom@^17 @testing-library/react@^12 @testing-library/react-hooks@^8 @testing-library/dom@^8 && node scripts/oldReactSupport.mjs", | |||
"install-canary": "yarn add -W react@canary react-dom@canary", | |||
"install-19": "node ./scripts/install-react-19-types.mjs && yarn add -W react@next react-dom@next", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should types for 19 always be installed?
# Conflicts: # packages/@react-aria/menu/src/useSubmenuTrigger.ts # packages/@react-aria/toast/src/useToast.ts # packages/@react-aria/toast/stories/Example.tsx # packages/@react-aria/utils/src/useEvent.ts # packages/@react-aria/utils/src/useResizeObserver.ts # packages/@react-aria/virtualizer/src/ScrollView.tsx # packages/@react-aria/virtualizer/src/Virtualizer.tsx # packages/@react-spectrum/calendar/src/Calendar.tsx # packages/@react-spectrum/calendar/src/CalendarCell.tsx # packages/@react-spectrum/calendar/src/RangeCalendar.tsx # packages/@react-spectrum/listbox/src/ListBoxBase.tsx # packages/@react-spectrum/table/src/TableViewBase.tsx # packages/@react-stately/tooltip/src/useTooltipTriggerState.ts # packages/react-aria-components/src/Menu.tsx # packages/react-aria-components/src/Table.tsx
1 similar comment
1 similar comment
expect(onLoadMore).toHaveBeenCalledTimes(1); | ||
let isReact19 = parseInt(React.version, 10) >= 19; | ||
if (isReact19 && layout !== GridLayout) { | ||
expect(onLoadMore).toHaveBeenCalledTimes(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these loadmore checks have always been sensitive to any change, I've checked it in the browser and didn't notice an issue
I'll put in a todo to address it, though almost anything with an isOldReact or isReact19 check should be updated/looked into more at some point
## API Changes
unknown top level export { type: 'any' } @react-aria/accordionuseAccordionItem useAccordionItem<T> {
props: AccordionItemAriaProps<T>
state: TreeState<T>
- ref: RefObject<HTMLButtonElement>
+ ref: RefObject<HTMLButtonElement | null>
returnVal: undefined
} useAccordion useAccordion<T> {
props: AriaAccordionProps<T>
state: TreeState<T>
- ref: RefObject<HTMLDivElement>
+ ref: RefObject<HTMLDivElement | null>
returnVal: undefined
} @react-aria/actiongroupuseActionGroup useActionGroup<T> {
props: AriaActionGroupProps<T>
state: ListState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useActionGroupItem useActionGroupItem<T> {
props: AriaActionGroupItemProps
state: ListState<T>
- ref?: RefObject<FocusableElement>
+ ref?: RefObject<FocusableElement | null>
returnVal: undefined
} @react-aria/autocompleteAriaSearchAutocompleteOptions AriaSearchAutocompleteOptions<T> {
- inputRef: RefObject<HTMLInputElement>
+ inputRef: RefObject<HTMLInputElement | null>
keyboardDelegate?: KeyboardDelegate
- listBoxRef: RefObject<HTMLElement>
- popoverRef: RefObject<HTMLDivElement>
+ listBoxRef: RefObject<HTMLElement | null>
+ popoverRef: RefObject<HTMLDivElement | null>
} it changed:
@react-aria/breadcrumbsuseBreadcrumbItem useBreadcrumbItem {
props: AriaBreadcrumbItemProps
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} @react-aria/calendaruseRangeCalendar useRangeCalendar<T extends DateValue> {
props: AriaRangeCalendarProps<T>
state: RangeCalendarState
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useCalendarCell useCalendarCell {
props: AriaCalendarCellProps
state: CalendarState | RangeCalendarState
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} @react-aria/checkboxuseCheckbox useCheckbox {
props: AriaCheckboxProps
state: ToggleState
- inputRef: RefObject<HTMLInputElement>
+ inputRef: RefObject<HTMLInputElement | null>
returnVal: undefined
} useCheckboxGroupItem useCheckboxGroupItem {
props: AriaCheckboxGroupItemProps
state: CheckboxGroupState
- inputRef: RefObject<HTMLInputElement>
+ inputRef: RefObject<HTMLInputElement | null>
returnVal: undefined
} @react-aria/coloruseColorWheel useColorWheel {
props: AriaColorWheelOptions
state: ColorWheelState
- inputRef: RefObject<HTMLInputElement>
+ inputRef: RefObject<HTMLInputElement | null>
returnVal: undefined
} useColorField useColorField {
props: AriaColorFieldProps
state: ColorFieldState
- ref: RefObject<HTMLInputElement>
+ ref: RefObject<HTMLInputElement | null>
returnVal: undefined
} useColorChannelField useColorChannelField {
props: AriaColorChannelFieldProps
state: ColorChannelFieldState
- inputRef: RefObject<HTMLInputElement>
+ inputRef: RefObject<HTMLInputElement | null>
returnVal: undefined
} AriaColorAreaOptions AriaColorAreaOptions {
- containerRef: RefObject<Element>
- inputXRef: RefObject<HTMLInputElement>
- inputYRef: RefObject<HTMLInputElement>
+ containerRef: RefObject<Element | null>
+ inputXRef: RefObject<HTMLInputElement | null>
+ inputYRef: RefObject<HTMLInputElement | null>
} it changed:
AriaColorSliderOptions AriaColorSliderOptions {
- inputRef: RefObject<HTMLInputElement>
- trackRef: RefObject<Element>
+ inputRef: RefObject<HTMLInputElement | null>
+ trackRef: RefObject<Element | null>
} it changed:
@react-aria/comboboxAriaComboBoxOptions AriaComboBoxOptions<T> {
- buttonRef?: RefObject<Element>
- inputRef: RefObject<HTMLInputElement>
+ buttonRef?: RefObject<Element | null>
+ inputRef: RefObject<HTMLInputElement | null>
keyboardDelegate?: KeyboardDelegate
- listBoxRef: RefObject<HTMLElement>
- popoverRef: RefObject<Element>
+ listBoxRef: RefObject<HTMLElement | null>
+ popoverRef: RefObject<Element | null>
} it changed:
@react-aria/datepickeruseDatePicker useDatePicker<T extends DateValue> {
props: AriaDatePickerProps<T>
state: DatePickerState
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
returnVal: undefined
} useDateSegment useDateSegment {
segment: DateSegment
state: DateFieldState
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useDateFieldchanged by:
useDateField<T extends DateValue> {
props: AriaDateFieldOptions<T>
state: DateFieldState
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
returnVal: undefined
} useTimeField useTimeField<T extends TimeValue> {
props: AriaTimeFieldOptions<T>
state: TimeFieldState
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
returnVal: undefined
} useDateRangePicker useDateRangePicker<T extends DateValue> {
props: AriaDateRangePickerProps<T>
state: DateRangePickerState
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
returnVal: undefined
} AriaDateFieldOptions AriaDateFieldOptions<T extends DateValue> {
- inputRef?: RefObject<HTMLInputElement>
+ inputRef?: RefObject<HTMLInputElement | null>
} it changed:
@react-aria/dialoguseDialog useDialog {
props: AriaDialogProps
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} @react-aria/dndDragOptions DragOptions {
getAllowedDropOperations?: () => Array<DropOperation>
getItems: () => Array<DragItem>
hasDragButton?: boolean
isDisabled?: boolean
onDragEnd?: (DragEndEvent) => void
onDragMove?: (DragMoveEvent) => void
onDragStart?: (DragStartEvent) => void
- preview?: RefObject<DragPreviewRenderer>
+ preview?: RefObject<DragPreviewRenderer | null>
} it changed:
DropOptions DropOptions {
getDropOperation?: (IDragTypes, Array<DropOperation>) => DropOperation
getDropOperationForPoint?: (IDragTypes, Array<DropOperation>, number, number) => DropOperation
hasDropButton?: boolean
isDisabled?: boolean
onDrop?: (DropEvent) => void
onDropEnter?: (DropEnterEvent) => void
onDropExit?: (DropExitEvent) => void
onDropMove?: (DropMoveEvent) => void
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
} it changed:
useDropchanged by:
useDroppableCollection {
props: DroppableCollectionOptions
state: DroppableCollectionState
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useDroppableCollection useDroppableItem {
options: DroppableItemOptions
state: DroppableCollectionState
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useDroppableItem useDropIndicator {
props: DropIndicatorProps
state: DroppableCollectionState
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useDraggableItem useDraggableCollection {
props: DraggableCollectionOptions
state: DraggableCollectionState
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} DragPreview ListDropTargetDelegate {
- constructor: (Collection<Node<unknown>>, RefObject<HTMLElement>, ListDropTargetDelegateOptions) => void
+ constructor: (Collection<Node<unknown>>, RefObject<HTMLElement | null>, ListDropTargetDelegateOptions) => void
getDropTargetFromPoint: (number, number, (DropTarget) => boolean) => DropTarget
} @react-aria/focuscreateFocusManager createFocusManager {
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
defaultOptions: FocusManagerOptions
returnVal: undefined
} useFocusable useFocusable {
props: FocusableOptions
- domRef: RefObject<FocusableElement>
+ domRef: RefObject<FocusableElement | null>
returnVal: undefined
} useHasTabbableChild useHasTabbableChild {
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
options?: AriaHasTabbableChildOptions
returnVal: undefined
} @react-aria/formuseFormValidation useFormValidation<T> {
props: FormValidationProps<T>
state: FormValidationState
- ref: RefObject<ValidatableElement> | undefined
+ ref: RefObject<ValidatableElement | null> | undefined
returnVal: undefined
} @react-aria/griduseGridchanged by:
useGrid<T> {
props: GridProps
state: GridState<T, GridCollection<T>>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useGridRow useGridRow<C extends GridCollection<T>, S extends GridState<T, C>, T> {
props: GridRowProps<T>
state: S
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useGridCell useGridCell<C extends GridCollection<T>, T> {
props: GridCellProps
state: GridState<T, C>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} GridProps GridProps {
focusMode?: 'row' | 'cell' = 'row'
getRowText?: (Key) => string = (key) => state.collection.getItem(key)?.textValue
isVirtualized?: boolean
keyboardDelegate?: KeyboardDelegate
onCellAction?: (Key) => void
onRowAction?: (Key) => void
- scrollRef?: RefObject<HTMLElement>
+ scrollRef?: RefObject<HTMLElement | null>
} it changed:
GridKeyboardDelegateOptions GridKeyboardDelegateOptions<C, T> {
collator?: Intl.Collator
collection: C
direction: Direction
disabledBehavior?: DisabledBehavior
disabledKeys: Set<Key>
focusMode?: 'row' | 'cell'
layout?: Layout<Node<T>>
- ref?: RefObject<HTMLElement>
+ ref?: RefObject<HTMLElement | null>
} it changed:
@react-aria/gridlistuseGridList useGridList<T> {
props: AriaGridListOptions<T>
state: ListState<T>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useGridListItem useGridListItem<T> {
props: AriaGridListItemOptions
state: ListState<T> | TreeState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} @react-aria/interactionsuseScrollWheel useScrollWheel {
props: ScrollWheelProps
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} InteractOutsideProps InteractOutsideProps {
isDisabled?: boolean
onInteractOutside?: (PointerEvent) => void
onInteractOutsideStart?: (PointerEvent) => void
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
} it changed:
PressHookProps PressHookProps {
allowTextSelectionOnPress?: boolean
isDisabled?: boolean
isPressed?: boolean
preventFocusOnPress?: boolean
- ref?: RefObject<Element>
+ ref?: RefObject<Element | null>
shouldCancelOnPointerExit?: boolean
} it changed:
@react-aria/landmarkuseLandmark useLandmark {
props: AriaLandmarkProps
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} @react-aria/linkuseLink useLink {
props: AriaLinkOptions
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} @react-aria/listboxuseListBox useListBox<T> {
props: AriaListBoxOptions<T>
state: ListState<T>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useOption useOption<T> {
props: AriaOptionProps
state: ListState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} @react-aria/menuuseMenuTrigger useMenuTrigger<T> {
props: AriaMenuTriggerProps
state: MenuTriggerState
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
returnVal: undefined
} useMenu useMenu<T> {
props: AriaMenuOptions<T>
state: TreeState<T>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useMenuItem useMenuItem<T> {
props: AriaMenuItemProps
state: TreeState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useSubmenuTriggerchanged by:
useSubmenuTrigger<T> {
props: AriaSubmenuTriggerProps
state: SubmenuTriggerState
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} AriaSubmenuTriggerProps AriaSubmenuTriggerProps {
delay?: number = 200
isDisabled?: boolean
- parentMenuRef: RefObject<HTMLElement>
- submenuRef: RefObject<HTMLElement>
+ parentMenuRef: RefObject<HTMLElement | null>
+ submenuRef: RefObject<HTMLElement | null>
type?: 'dialog' | 'menu'
} it changed:
@react-aria/numberfielduseNumberField useNumberField {
props: AriaNumberFieldProps
state: NumberFieldState
- inputRef: RefObject<HTMLInputElement>
+ inputRef: RefObject<HTMLInputElement | null>
returnVal: undefined
} @react-aria/overlaysuseOverlay useOverlay {
props: AriaOverlayProps
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
returnVal: undefined
} useOverlayTrigger useOverlayTrigger {
props: OverlayTriggerProps
state: OverlayTriggerState
- ref?: RefObject<Element>
+ ref?: RefObject<Element | null>
returnVal: undefined
} useModalOverlay useModalOverlay {
props: AriaModalOverlayProps
state: OverlayTriggerState
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} AriaPositionProps AriaPositionProps {
arrowBoundaryOffset?: number = 0
arrowSize?: number = 0
boundaryElement?: Element = document.body
maxHeight?: number
onClose?: () => void
- overlayRef: RefObject<Element>
- scrollRef?: RefObject<Element> = overlayRef
+ overlayRef: RefObject<Element | null>
+ scrollRef?: RefObject<Element | null> = overlayRef
shouldUpdatePosition?: boolean = true
- targetRef: RefObject<Element>
+ targetRef: RefObject<Element | null>
} it changed:
AriaPopoverProps AriaPopoverProps {
isKeyboardDismissDisabled?: boolean = false
isNonModal?: boolean
- popoverRef: RefObject<Element>
+ popoverRef: RefObject<Element | null>
shouldCloseOnInteractOutside?: (Element) => boolean
- triggerRef: RefObject<Element>
+ triggerRef: RefObject<Element | null>
} it changed:
@react-aria/radiouseRadio useRadio {
props: AriaRadioProps
state: RadioGroupState
- ref: RefObject<HTMLInputElement>
+ ref: RefObject<HTMLInputElement | null>
returnVal: undefined
} @react-aria/searchfielduseSearchField useSearchField {
props: AriaSearchFieldProps
state: SearchFieldState
- inputRef: RefObject<HTMLInputElement>
+ inputRef: RefObject<HTMLInputElement | null>
returnVal: undefined
} @react-aria/selectuseSelect useSelect<T> {
props: AriaSelectOptions<T>
state: SelectState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useHiddenSelect useHiddenSelect<T> {
props: AriaHiddenSelectOptions
state: SelectState<T>
- triggerRef: RefObject<FocusableElement>
+ triggerRef: RefObject<FocusableElement | null>
returnVal: undefined
} HiddenSelect HiddenSelect<T> {
autoComplete?: string
isDisabled?: boolean
label?: ReactNode
name?: string
state: SelectState<T>
- triggerRef: RefObject<FocusableElement>
+ triggerRef: RefObject<FocusableElement | null>
} HiddenSelectProps HiddenSelectProps<T> {
autoComplete?: string
isDisabled?: boolean
label?: ReactNode
name?: string
state: SelectState<T>
- triggerRef: RefObject<FocusableElement>
+ triggerRef: RefObject<FocusableElement | null>
} @react-aria/selectionAriaSelectableCollectionOptions AriaSelectableCollectionOptions {
allowsTabNavigation?: boolean
autoFocus?: boolean | FocusStrategy = false
disallowEmptySelection?: boolean = false
disallowSelectAll?: boolean = false
disallowTypeAhead?: boolean = false
isVirtualized?: boolean
keyboardDelegate: KeyboardDelegate
linkBehavior?: 'action' | 'selection' | 'override' = 'action'
- ref: RefObject<HTMLElement>
- scrollRef?: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
+ scrollRef?: RefObject<HTMLElement | null>
selectOnFocus?: boolean = false
selectionManager: MultipleSelectionManager
shouldFocusWrap?: boolean = false
shouldUseVirtualFocus?: boolean
it changed:
SelectableItemOptions SelectableItemOptions {
allowsDifferentPressOrigin?: boolean
focus?: () => void
isDisabled?: boolean
isVirtualized?: boolean
key: Key
linkBehavior?: 'action' | 'selection' | 'override' | 'none' = 'action'
onAction?: () => void
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
selectionManager: MultipleSelectionManager
shouldSelectOnPressUp?: boolean
shouldUseVirtualFocus?: boolean
} it changed:
@react-aria/slideruseSlider useSlider<T extends number | Array<number>> {
props: AriaSliderProps<T>
state: SliderState
- trackRef: RefObject<Element>
+ trackRef: RefObject<Element | null>
returnVal: undefined
} AriaSliderThumbOptions AriaSliderThumbOptions {
- inputRef: RefObject<HTMLInputElement>
- trackRef: RefObject<Element>
+ inputRef: RefObject<HTMLInputElement | null>
+ trackRef: RefObject<Element | null>
} it changed:
@react-aria/steplistuseStepList useStepList<T> {
props: AriaStepListProps<T>
state: StepListState<T>
- ref: RefObject<HTMLOListElement>
+ ref: RefObject<HTMLOListElement | null>
returnVal: undefined
} useStepListItem useStepListItem<T> {
props: AriaStepListItemProps
state: StepListState<T>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} @react-aria/switchuseSwitch useSwitch {
props: AriaSwitchProps
state: ToggleState
- ref: RefObject<HTMLInputElement>
+ ref: RefObject<HTMLInputElement | null>
returnVal: undefined
} @react-aria/tableuseTable useTable<T> {
props: AriaTableProps<T>
state: TableState<T> | TreeGridState<T>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useTableColumnHeader useTableColumnHeader<T> {
props: AriaTableColumnHeaderProps<T>
state: TableState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useTableRow useTableRow<T> {
props: GridRowProps<T>
state: TableState<T> | TreeGridState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useTableHeaderRow useTableHeaderRow<T> {
props: GridRowProps<T>
state: TableState<T>
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
returnVal: undefined
} useTableCell useTableCell<T> {
props: AriaTableCellProps
state: TableState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useTableColumnResizechanged by:
useTableColumnResize<T> {
props: AriaTableColumnResizeProps<T>
state: TableColumnResizeState<T>
- ref: RefObject<HTMLInputElement>
+ ref: RefObject<HTMLInputElement | null>
returnVal: undefined
} AriaTableColumnResizeProps AriaTableColumnResizeProps<T> {
aria-label: string
column: GridNode<T>
isDisabled?: boolean
onResize?: (Map<Key, ColumnSize>) => void
onResizeEnd?: (Map<Key, ColumnSize>) => void
onResizeStart?: (Map<Key, ColumnSize>) => void
- triggerRef?: RefObject<FocusableElement>
+ triggerRef?: RefObject<FocusableElement | null>
} it changed:
@react-aria/tabsuseTab useTab<T> {
props: AriaTabProps
state: TabListState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useTabPanel useTabPanel<T> {
props: AriaTabPanelProps
state: TabListState<T>
- ref: RefObject<Element>
+ ref: RefObject<Element | null>
returnVal: undefined
} useTabList useTabList<T> {
props: AriaTabListOptions<T>
state: TabListState<T>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} @react-aria/taguseTag useTag<T> {
props: AriaTagProps<T>
state: ListState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useTagGroup useTagGroup<T> {
props: AriaTagGroupOptions<T>
state: ListState<T>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} @react-aria/textfielduseFormattedTextField useFormattedTextField {
props: AriaTextFieldProps
state: FormattedTextFieldState
- inputRef: RefObject<HTMLInputElement>
+ inputRef: RefObject<HTMLInputElement | null>
returnVal: undefined
} @react-aria/toastuseToast useToast<T> {
props: AriaToastProps<T>
state: ToastState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} useToastRegion useToastRegion<T> {
props: AriaToastRegionProps
state: ToastState<T>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} @react-aria/toggleuseToggle useToggle {
props: AriaToggleProps
state: ToggleState
- ref: RefObject<HTMLInputElement>
+ ref: RefObject<HTMLInputElement | null>
returnVal: undefined
} @react-aria/toolbaruseToolbar useToolbar {
props: AriaToolbarProps
- ref: RefObject<HTMLDivElement>
+ ref: RefObject<HTMLDivElement | null>
returnVal: undefined
} @react-aria/tooltipuseTooltipTrigger useTooltipTrigger {
props: TooltipTriggerProps
state: TooltipTriggerState
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} @react-aria/treeuseTreeGridList useTreeGridList<T> {
props: AriaTreeGridListOptions<T>
state: TreeState<T>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} useTreeGridListItem useTreeGridListItem<T> {
props: AriaTreeGridListItemOptions
state: TreeState<T>
- ref: RefObject<FocusableElement>
+ ref: RefObject<FocusableElement | null>
returnVal: undefined
} @react-aria/utilsuseResizeObserver useSyncRef<T> {
context?: ContextValue<T> | null
- ref?: RefObject<T>
+ ref?: RefObject<T | null>
returnVal: undefined
} useDescription useEvent<K extends keyof GlobalEventHandlersEventMap> {
- ref: RefObject<EventTarget>
+ ref: RefObject<EventTarget | null>
event: K | (string & {
})
handler?: (Document, GlobalEventHandlersEventMap[K]) => any
returnVal: undefined
}
useEvent useFormReset<T> {
- ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>
+ ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null>
initialValue: T
onReset: (T) => void
returnVal: undefined
} @react-aria/virtualizerVirtualizerItemOptions VirtualizerItemOptions {
layoutInfo: LayoutInfo
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
virtualizer: IVirtualizer
} it changed:
useVirtualizer useVirtualizer<T extends {}, V extends ReactNode, W> {
props: VirtualizerOptions
state: VirtualizerState<T, V, W>
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} @react-spectrum/dialoguseDialogContainer SpectrumDialogTriggerProps {
children: [ReactElement, SpectrumDialogClose | ReactElement]
hideArrow?: boolean
isDismissable?: boolean
isKeyboardDismissDisabled?: boolean
mobileType?: 'modal' | 'tray' | 'fullscreen' | 'fullscreenTakeover'
- targetRef?: RefObject<HTMLElement>
+ targetRef?: RefObject<HTMLElement | null>
type?: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover' = 'modal'
} @react-spectrum/iconIcon Icon {
aria-hidden?: boolean | 'false' | 'true'
aria-label?: string
- children: ReactElement
+ children: ReactElement<any>
color?: IconColorValue
size?: 'XXS' | 'XS' | 'S' | 'M' | 'L' | 'XL' | 'XXL'
slot?: string = 'icon'
} UIIcon UIIcon {
aria-hidden?: boolean | 'false' | 'true'
- children: ReactElement
+ children: ReactElement<any>
slot?: string
} Illustration Illustration {
aria-hidden?: boolean | 'false' | 'true'
aria-label?: string
- children: ReactElement
+ children: ReactElement<any>
slot?: string = 'illustration'
} IconProps IconProps {
aria-hidden?: boolean | 'false' | 'true'
aria-label?: string
- children: ReactElement
+ children: ReactElement<any>
color?: IconColorValue
size?: 'XXS' | 'XS' | 'S' | 'M' | 'L' | 'XL' | 'XXL'
slot?: string = 'icon'
} it changed:
IllustrationProps IllustrationProps {
aria-hidden?: boolean | 'false' | 'true'
aria-label?: string
- children: ReactElement
+ children: ReactElement<any>
slot?: string = 'illustration'
} it changed:
UIIconProps UIIconProps {
aria-hidden?: boolean | 'false' | 'true'
- children: ReactElement
+ children: ReactElement<any>
slot?: string
} it changed:
@react-spectrum/menuMenuTrigger SubmenuTrigger {
- children: Array<ReactElement>
+ children: Array<ReactElement<any>>
targetKey: Key
} SpectrumMenuProps SpectrumSubmenuTriggerProps {
- children: Array<ReactElement>
+ children: Array<ReactElement<any>>
} @react-spectrum/textfieldTextArea TextFieldBase {
descriptionProps?: HTMLAttributes<HTMLElement>
disableFocusRing?: boolean
errorMessageProps?: HTMLAttributes<HTMLElement>
inputClassName?: string
inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>
- inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>
+ inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | null>
isLoading?: boolean
labelProps?: LabelHTMLAttributes<HTMLLabelElement>
loadingIndicator?: ReactElement
multiLine?: boolean
wrapperChildren?: ReactElement | Array<ReactElement>
}
@react-spectrum/utilsuseMediaQuery createDOMRef<T extends HTMLElement = HTMLElement> {
- ref: RefObject<T>
+ ref: RefObject<T | null>
returnVal: undefined
} createDOMRef createFocusableRef<T extends HTMLElement = HTMLElement> {
- domRef: RefObject<T>
- focusableRef: RefObject<FocusableElement>
+ domRef: RefObject<T | null>
+ focusableRef: RefObject<FocusableElement | null>
returnVal: undefined
} useDOMRef useFocusableRef<T extends HTMLElement = HTMLElement> {
ref: FocusableRef<T>
- focusableRef?: RefObject<FocusableElement>
+ focusableRef?: RefObject<FocusableElement | null>
returnVal: undefined
} useFocusableRef unwrapDOMRef<T extends HTMLElement> {
- ref: RefObject<DOMRefValue<T>>
+ ref: RefObject<DOMRefValue<T> | null>
returnVal: undefined
} unwrapDOMRef useUnwrapDOMRef<T extends HTMLElement> {
- ref: RefObject<DOMRefValue<T>>
+ ref: RefObject<DOMRefValue<T> | null>
returnVal: undefined
} ClearSlots useHasChild {
query: string
- ref: RefObject<HTMLElement>
+ ref: RefObject<HTMLElement | null>
returnVal: undefined
} @react-stately/dndDraggableCollectionState DraggableCollectionState {
collection: Collection<Node<unknown>>
draggedKey: Key | null
draggingKeys: Set<Key>
endDrag: (DraggableCollectionEndEvent) => void
getAllowedDropOperations?: () => Array<DropOperation>
getItems: (Key) => Array<DragItem>
getKeysForDrag: (Key) => Set<Key>
isDisabled?: boolean
isDragging: (Key) => boolean
moveDrag: (DragMoveEvent) => void
- preview?: RefObject<DragPreviewRenderer>
+ preview?: RefObject<DragPreviewRenderer | null>
selectionManager: MultipleSelectionManager
startDrag: (Key, DragStartEvent) => void
} it changed:
|
Closes #6445
Types for React 19 have not been released yet, but can work off the pre-release following eps1lon#1
Unresolved issues
framer-motion uses the deprecated, global JSX namespace. Tracking in eps1lon/DefinitelyTyped#25
lucide-react uses removed ReactSVG type. Tracking in eps1lon/DefinitelyTyped#25
Dev docs build: mdx-js/mdx#2487
markdown-to-jsx: quantizor/markdown-to-jsx#583
Need to upgrade to Storybook 8, might address some type issues
Testing-library-react might need an upgrade
We can probably patch-package most of these TS errors if we need
On another note, the whole JSX global namespace removal is causing all kinds of issues apparently DefinitelyTyped/DefinitelyTyped#69142