Skip to content

feat(react-image): add useImageBase_unstable hook#35808

Merged
dmytrokirpa merged 5 commits into
masterfrom
feat/react-image-base-hooks
Mar 23, 2026
Merged

feat(react-image): add useImageBase_unstable hook#35808
dmytrokirpa merged 5 commits into
masterfrom
feat/react-image-base-hooks

Conversation

@dmytrokirpa

@dmytrokirpa dmytrokirpa commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds ImageBaseProps type derived from ImageProps by omitting design props (shape, shadow, bordered, fit)
  • Adds ImageBaseState type derived from ImageState by omitting the same design props
  • Adds useImageBase_unstable hook that handles pure slot structure logic (the root img slot and block prop) without any design-specific concerns
  • Refactors useImage_unstable to call useImageBase_unstable and spread its results, then add design props
  • Exports new types and hook from packages/react-components/react-image/library/src/index.ts

What base hooks do

Base hooks extract pure component logic — ARIA, keyboard handling, slot structure — WITHOUT styling, design props, or default slot implementations. This allows consumers to build custom-styled variants without taking on the full FluentUI design system.

🤖 Generated with Claude Code

@dmytrokirpa dmytrokirpa changed the base branch from experimental/component-base-hooks to master March 3, 2026 17:26
dmytrokirpa and others added 2 commits March 5, 2026 11:16
Adds ImageBaseProps, ImageBaseState types and useImageBase_unstable hook to the react-image package.
The base hook extracts pure slot structure logic without design-specific props (shape, shadow, bordered, fit).
The styled useImage_unstable hook is refactored to call the base hook and spread its results.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@dmytrokirpa dmytrokirpa force-pushed the feat/react-image-base-hooks branch from ccca3d3 to aa6a093 Compare March 5, 2026 10:16
@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.62 kB
68.716 kB
236.65 kB
68.725 kB
30 B
9 B
react-components
react-components: entire library
1.292 MB
323.336 kB
1.293 MB
323.353 kB
30 B
17 B
react-image
Image
13.578 kB
5.518 kB
13.608 kB
5.533 kB
30 B
15 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: 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 55ade976605866015dbc1d8b629513bc7515e1fe

@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown

Pull request demo site: URL

@dmytrokirpa dmytrokirpa force-pushed the feat/react-image-base-hooks branch from 9492773 to 87f0ad6 Compare March 18, 2026 19:41
@dmytrokirpa dmytrokirpa marked this pull request as ready for review March 18, 2026 19:41
@dmytrokirpa dmytrokirpa requested a review from a team as a code owner March 18, 2026 19:41
@dmytrokirpa dmytrokirpa self-assigned this Mar 18, 2026
@dmytrokirpa dmytrokirpa merged commit 35fe795 into master Mar 23, 2026
15 checks passed
tudorpopams pushed a commit to tudorpopams/fluentui that referenced this pull request Apr 14, 2026
@dmytrokirpa dmytrokirpa deleted the feat/react-image-base-hooks branch May 23, 2026 10:30
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.

2 participants