Skip to content

fix: replace deprecated element.ref usages to support react 19 - #35030

Merged
Dmytro Kirpa (dmytrokirpa) merged 6 commits into
microsoft:masterfrom
dmytrokirpa:fix/child-ref-support-react-19
Aug 19, 2025
Merged

Dmytro Kirpa (dmytrokirpa) merged 6 commits into
microsoft:masterfrom
dmytrokirpa:fix/child-ref-support-react-19

Conversation

@dmytrokirpa

Copy link
Copy Markdown
Contributor

Previous Behavior

Accessing element.ref is deprecated: https://react.dev/blog/2024/04/25/react-19-upgrade-guide#deprecated-element-ref

We have various places where we work with elements directly and access refs:




etc

New Behavior

  • added a new helper getReactElementRef that returns element's ref in a backward compatible way
  • replaced usages of element?.ref with getReactElementRef(element)

Related Issue(s)

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@github-actions

github-actions Bot commented Aug 15, 2025 •

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-accordion
Accordion (including children components)
108.369 kB
33.133 kB
108.395 kB
33.141 kB
26 B
8 B
react-charts
AreaChart
378.2 kB
114.998 kB
378.216 kB
115.019 kB
16 B
21 B
react-charts
DeclarativeChart
628.71 kB
179.108 kB
628.726 kB
179.139 kB
16 B
31 B
react-charts
DonutChart
294.296 kB
87.988 kB
294.327 kB
88.02 kB
31 B
32 B
react-charts
FunnelChart
287.557 kB
85.485 kB
287.588 kB
85.513 kB
31 B
28 B
react-charts
GanttChart
362.384 kB
108.878 kB
362.4 kB
108.9 kB
16 B
22 B
react-charts
GaugeChart
310.673 kB
92.028 kB
310.689 kB
92.035 kB
16 B
7 B
react-charts
GroupedVerticalBarChart
363.214 kB
108.904 kB
363.23 kB
108.929 kB
16 B
25 B
react-charts
HeatMapChart
360.764 kB
109.231 kB
360.78 kB
109.243 kB
16 B
12 B
react-charts
HorizontalBarChart
294.972 kB
86.746 kB
294.988 kB
86.789 kB
16 B
43 B
react-charts
Legends
234.759 kB
69.433 kB
234.79 kB
69.458 kB
31 B
25 B
react-charts
LineChart
384.929 kB
115.802 kB
384.945 kB
115.838 kB
16 B
36 B
react-charts
ScatterChart
363.307 kB
109.083 kB
363.323 kB
109.129 kB
16 B
46 B
react-charts
VerticalBarChart
401.819 kB
115.623 kB
401.835 kB
115.655 kB
16 B
32 B
react-charts
VerticalStackedBarChart
373.473 kB
111.612 kB
373.489 kB
111.65 kB
16 B
38 B
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.541 kB
68.47 kB
236.537 kB
68.489 kB
-4 B
19 B
react-components
react-components: entire library
1.278 MB
321.584 kB
1.278 MB
321.597 kB
-87 B
13 B
react-dialog
Dialog (including children components)
102.467 kB
30.624 kB
102.478 kB
30.635 kB
11 B
11 B
react-menu
Menu (including children components)
165.016 kB
49.946 kB
165.085 kB
49.991 kB
69 B
45 B
react-menu
Menu (including selectable components)
167.998 kB
50.542 kB
168.067 kB
50.588 kB
69 B
46 B
react-motion
@fluentui/react-motion - createMotionComponent()
3.995 kB
1.755 kB
4.019 kB
1.761 kB
24 B
6 B
react-motion
@fluentui/react-motion - createPresenceComponent()
5.65 kB
2.36 kB
5.674 kB
2.368 kB
24 B
8 B
react-popover
Popover
132.198 kB
41.134 kB
132.27 kB
41.172 kB
72 B
38 B
react-toast
Toast (including Toaster)
103.48 kB
30.971 kB
103.506 kB
30.989 kB
26 B
18 B
react-tooltip
Tooltip
57.853 kB
20.037 kB
57.922 kB
20.084 kB
69 B
47 B
react-tree
FlatTree
149.134 kB
42.662 kB
149.16 kB
42.672 kB
26 B
10 B
react-tree
PersonaFlatTree
149.89 kB
42.78 kB
149.916 kB
42.803 kB
26 B
23 B
react-tree
PersonaTree
146.147 kB
41.638 kB
146.173 kB
41.657 kB
26 B
19 B
react-tree
Tree
145.397 kB
41.503 kB
145.423 kB
41.516 kB
26 B
13 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
510 B
328 B
global-context
createContextSelector
537 B
339 B
react-aria
ARIA - Default
237 B
181 B
react-avatar
Avatar
48.518 kB
15.508 kB
react-avatar
AvatarGroup
19.235 kB
7.617 kB
react-avatar
AvatarGroupItem
62.662 kB
19.727 kB
react-badge
Badge
25.06 kB
8.242 kB
react-badge
CounterBadge
25.84 kB
8.517 kB
react-badge
PresenceBadge
24.929 kB
9.147 kB
react-breadcrumb
@fluentui/react-breadcrumb - package
114.212 kB
31.517 kB
react-button
Button
36.705 kB
10.508 kB
react-button
CompoundButton
43.117 kB
11.812 kB
react-button
MenuButton
41.6 kB
11.902 kB
react-button
SplitButton
49.667 kB
13.477 kB
react-button
ToggleButton
52.636 kB
12.285 kB
react-calendar-compat
Calendar Compat
149.762 kB
39.933 kB
react-card
Card - All
101.577 kB
28.578 kB
react-card
Card
94.223 kB
26.749 kB
react-card
CardFooter
13.662 kB
5.517 kB
react-card
CardHeader
16.195 kB
6.38 kB
react-card
CardPreview
13.729 kB
5.645 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
SankeyChart
198.471 kB
60.992 kB
react-charts
Sparkline
91.115 kB
28.688 kB
react-checkbox
Checkbox
34.335 kB
11.786 kB
react-color-picker
ColorArea
49.32 kB
17.32 kB
react-color-picker
ColorPicker
17.95 kB
7.143 kB
react-color-picker
ColorSlider
41.493 kB
15.375 kB
react-combobox
Combobox (including child components)
106.952 kB
34.798 kB
react-combobox
Dropdown (including child components)
107.582 kB
34.719 kB
react-components
react-components: Button, FluentProvider & webLightTheme
68.79 kB
19.902 kB
react-components
react-components: FluentProvider & webLightTheme
43.624 kB
14.255 kB
react-datepicker-compat
DatePicker Compat
226.614 kB
64.087 kB
react-divider
Divider
20.626 kB
7.654 kB
react-field
Field
22.657 kB
8.602 kB
react-image
Image
14.489 kB
5.882 kB
react-input
Input
27.148 kB
9.108 kB
react-jsx-runtime
Classic Pragma
1.101 kB
550 B
react-jsx-runtime
JSX Dev Runtime
2.8 kB
1.251 kB
react-jsx-runtime
JSX Runtime
3.422 kB
1.493 kB
react-label
Label
13.799 kB
5.644 kB
react-link
Link
16.746 kB
6.785 kB
react-list
List
88.892 kB
26.38 kB
react-list
ListItem
112.276 kB
33.202 kB
react-message-bar
MessageBar (all components)
24.088 kB
8.96 kB
react-motion
@fluentui/react-motion - PresenceGroup
1.727 kB
823 B
react-overflow
hooks only
12.854 kB
4.828 kB
react-persona
Persona
55.409 kB
17.389 kB
react-portal
Portal
15.411 kB
5.385 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-positioning
usePositioning
28.865 kB
10.146 kB
react-positioning
useSafeZoneArea
12.29 kB
4.967 kB
react-progress
ProgressBar
16.593 kB
6.613 kB
react-provider
FluentProvider
23.8 kB
8.556 kB
react-radio
Radio
31.8 kB
10.006 kB
react-radio
RadioGroup
14.889 kB
6.09 kB
react-select
Select
26.95 kB
9.833 kB
react-slider
Slider
37.211 kB
12.461 kB
react-spinbutton
SpinButton
34.431 kB
11.449 kB
react-spinner
Spinner
24.374 kB
8.192 kB
react-swatch-picker
@fluentui/react-swatch-picker - package
106.039 kB
30.537 kB
react-switch
Switch
34.51 kB
11.014 kB
react-table
DataGrid
161.275 kB
45.589 kB
react-table
Table (Primitives only)
41.978 kB
13.573 kB
react-table
Table as DataGrid
131.476 kB
36.341 kB
react-table
Table (Selection only)
69.846 kB
19.704 kB
react-table
Table (Sort only)
68.489 kB
19.321 kB
react-tag-picker
@fluentui/react-tag-picker - package
188.294 kB
56.452 kB
react-tags
InteractionTag
14.561 kB
5.865 kB
react-tags
Tag
30.33 kB
9.76 kB
react-tags
TagGroup
83.089 kB
24.555 kB
react-teaching-popover
TeachingPopover
102.747 kB
30.737 kB
react-text
Text - Default
16.19 kB
6.366 kB
react-text
Text - Wrappers
19.35 kB
6.695 kB
react-textarea
Textarea
25.53 kB
9.361 kB
react-timepicker-compat
TimePicker
109.935 kB
36.335 kB
react-utilities
SSRProvider
180 B
160 B
🤖 This report was generated against 3d11f19773afbb244164e60e9dfd1e6a44001993

@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) force-pushed the fix/child-ref-support-react-19 branch from c1f6f52 to be2a04a Compare August 18, 2025 08:35
@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) merged commit 1903d94 into microsoft:master Aug 19, 2025
@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) deleted the fix/child-ref-support-react-19 branch August 19, 2025 13:19
Tudor Popa (tudorpopams) pushed a commit to tudorpopams/fluentui that referenced this pull request Apr 14, 2026
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.

[Bug]: React 19, Accessing element.ref is no longer supported

3 participants