Skip to content

TagGroup: remove useTagGroupState#4359

Merged
reidbarber merged 6 commits into
mainfrom
remove-usetaggroup
Apr 11, 2023
Merged

TagGroup: remove useTagGroupState#4359
reidbarber merged 6 commits into
mainfrom
remove-usetaggroup

Conversation

@reidbarber
Copy link
Copy Markdown
Member

@reidbarber reidbarber commented Apr 10, 2023

We can remove useTagGroupState since useListState should have everything we need to manage state for a tag group.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Comment thread packages/@react-spectrum/tag/src/TagGroup.tsx
let ref = React.useRef(null);

let state = useTagGroupState(props);
let state = useListState(props);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This should be fine to go out now, and is necessary to build.

@rspbot
Copy link
Copy Markdown

rspbot commented Apr 11, 2023

@rspbot
Copy link
Copy Markdown

rspbot commented Apr 11, 2023

@rspbot
Copy link
Copy Markdown

rspbot commented Apr 11, 2023

## API Changes

unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }

@react-aria/tag

useTag

 useTag<T> {
   props: AriaTagProps<T>
-  state: TagGroupState<T>
+  state: ListState<T>
   ref: RefObject<FocusableElement>
   returnVal: undefined
 }

useTagGroup

 useTagGroup<T> {
   props: AriaTagGroupProps<T>
-  state: TagGroupState<T>
+  state: ListState<T>
   ref: RefObject<HTMLElement>
   returnVal: undefined
 }

tmp/dist/base-api/@react-stately/tag

useTagGroupState

changed by:

  • TagGroupState
-useTagGroupState<T extends {}> {
-  props: TagGroupProps<T>
-  returnVal: undefined
-}
+

TagGroupState

-TagGroupState<T> {
-  onRemove?: (Key) => void
-}
+

it changed:

  • useTagGroupState

TagGroupProps

-TagGroupProps<T> {
-  allowsRemoving?: boolean
-  maxRows?: number
-  onRemove?: (Key) => void
-}
+

@reidbarber reidbarber merged commit 950d45d into main Apr 11, 2023
@reidbarber reidbarber deleted the remove-usetaggroup branch April 11, 2023 22:46
cgood92 pushed a commit to cgood92/react-spectrum that referenced this pull request May 9, 2023
* remove useTagGroup

* fix type

* remove deps

* lint

* remove from docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants