Skip to content
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

chore: Update react-aria dependencies #75091

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion static/app/components/comboBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import styled from '@emotion/styled';
import {useComboBox} from '@react-aria/combobox';
import {Item, Section} from '@react-stately/collections';
import {type ComboBoxStateOptions, useComboBoxState} from '@react-stately/combobox';
import type {Key} from '@react-types/shared';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the heck are react-types

Copy link
Member Author

@ryan953 ryan953 Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's something from react-aria

lemme findout what i can

it's something from react-aria

All the components depend on these types a lot. for example, from yarn.lock: @react-aria/button depends on @react-types/button and @react-types/shared

"@react-aria/button@^3.9.1":
  version "3.9.1"
  resolved "https://registry.yarnpkg.com/@react-aria/button/-/button-3.9.1.tgz#f76f8a74fe6c6b3ffe1fc446d6f750188a33042e"
  integrity sha512-nAnLMUAnwIVcRkKzS1G2IU6LZSkIWPJGu9amz/g7Y02cGUwFp3lk5bEw2LdoaXiSDJNSX8g0SZFU8FROg57jfQ==
  dependencies:
    "@react-aria/focus" "^3.16.0"
    "@react-aria/interactions" "^3.20.1"
    "@react-aria/utils" "^3.23.0"
    "@react-stately/toggle" "^3.7.0"
    "@react-types/button" "^3.9.1"
    "@react-types/shared" "^3.22.0"
    "@swc/helpers" "^0.5.0"


https://www.npmjs.com/package/@react-types/shared

import omit from 'lodash/omit';

import type {SelectOption} from 'sentry/components/compactSelect';
Expand Down Expand Up @@ -278,7 +279,7 @@ function ControlledComboBox<Value extends string>({
valueRef.current = value;

const handleChange = useCallback(
(key: string | number) => {
(key: Key | null) => {
// Prevent calling onChange on closing the menu without selecting a different value
if (getEscapedKey(valueRef.current) === key) {
return;
Expand Down
4 changes: 2 additions & 2 deletions static/app/components/searchQueryBuilder/tokens/combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ function SearchQueryBuilderComboboxInner<T extends SelectOptionOrSectionWithKey<
});

const onSelectionChange = useCallback(
(key: Key) => {
const selectedOption = findItemInSections(items, key);
(key: Key | null) => {
const selectedOption = key ? findItemInSections(items, key) : null;
if (selectedOption && 'textValue' in selectedOption && selectedOption.textValue) {
onOptionSelected(selectedOption.textValue);
} else if (key) {
Expand Down
Loading
Loading