Skip to content

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

Open
dmytrokirpa wants to merge 2 commits intomicrosoft:masterfrom
dmytrokirpa:feat/react-select-base-hooks
Open

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

Conversation

@dmytrokirpa
Copy link
Copy Markdown
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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.297 MB
324.018 kB
1.297 MB
324.052 kB
80 B
34 B
react-select
Select
26.085 kB
9.437 kB
26.165 kB
9.472 kB
80 B
35 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.663 kB
68.729 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 60e59306fff71cffb065250b2b1a68490d0528f3

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

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>
@dmytrokirpa dmytrokirpa force-pushed the feat/react-select-base-hooks branch from 4dfc754 to f5885e9 Compare March 26, 2026 23:41
@dmytrokirpa dmytrokirpa marked this pull request as ready for review March 26, 2026 23:42
@dmytrokirpa dmytrokirpa requested review from a team and mainframev as code owners March 26, 2026 23:42
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