Skip to content

feat(react-select): add useSelectBase_unstable hook#35906

Draft
dmytrokirpa wants to merge 1 commit intomicrosoft:masterfrom
dmytrokirpa:feat/react-select-base-hooks
Draft

feat(react-select): add useSelectBase_unstable hook#35906
dmytrokirpa wants to merge 1 commit intomicrosoft:masterfrom
dmytrokirpa:feat/react-select-base-hooks

Conversation

@dmytrokirpa
Copy link
Contributor

Summary

  • Adds useSelectBase_unstable hook that exposes the core slot/ARIA/event logic of Select without design-specific props (appearance, size)
  • Adds SelectBaseProps and SelectBaseState types (DistributiveOmit<..., 'appearance' | 'size'>)
  • Refactors useSelect_unstable to delegate to the base hook, then layer on field control props, overrides, and the ChevronDownRegular icon default
  • Updates renderSelect_unstable to accept SelectBaseState (render only uses slot props, not design props)

Test plan

  • yarn nx build react-select — passes, API md updated
  • yarn nx lint react-select — passes
  • yarn nx test react-select — 29 tests pass

Part of #35562

🤖 Generated with Claude Code

Adds `useSelectBase_unstable` hook and `SelectBaseProps`/`SelectBaseState` types that expose the core slot/event logic without design-specific props (`appearance`, `size`). The styled `useSelect_unstable` now delegates to the base hook and applies defaults (ChevronDownRegular icon, field control props, overrides). Updates `renderSelect_unstable` to accept `SelectBaseState`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.297 MB
324.029 kB
1.297 MB
324.055 kB
76 B
26 B
react-select
Select
26.085 kB
9.437 kB
26.165 kB
9.471 kB
80 B
34 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
70.397 kB
19.96 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.65 kB
68.725 kB
react-components
react-components: FluentProvider & webLightTheme
43.612 kB
14.022 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-timepicker-compat
TimePicker
108.174 kB
35.695 kB
🤖 This report was generated against dc6108e6bec042117f717ccdf0232446eef137d4

@github-actions
Copy link

Pull request demo site: URL

@@ -0,0 +1,7 @@
{

Choose a reason for hiding this comment

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

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Avatar Converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Avatar Converged.badgeMask.normal.chromium.png 3 Changed
vr-tests-react-components/Charts-DonutChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic.default.chromium.png 5581 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png 404 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png 413 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 620 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 35 Changed
vr-tests-react-components/TagPicker 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - RTL.chromium.png 635 Changed
vr-tests-react-components/TagPicker.disabled.disabled input hover.chromium.png 677 Changed

There were 2 duplicate changes discarded. Check the build logs for more information.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant