Skip to content

Commit e6c7614

Browse files
fix(Label): Add missing ref for Label without sx prop (#6535)
Co-authored-by: primer[bot] <119360173+primer[bot]@users.noreply.github.com>
1 parent 661eae0 commit e6c7614

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/five-squids-sin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': minor
3+
---
4+
5+
fix(Label): Add missing ref for Label without sx prop

packages/react/src/Label/Label.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ const Label = React.forwardRef(function Label({as, size = 'small', variant = 'de
8181
/>
8282
)
8383
}
84-
return <Component className={clsx(className, classes.Label)} data-size={size} data-variant={variant} {...rest} />
84+
return (
85+
<Component className={clsx(className, classes.Label)} data-size={size} data-variant={variant} ref={ref} {...rest} />
86+
)
8587
}) as PolymorphicForwardRefComponent<'span', LabelProps>
8688

8789
export default Label

0 commit comments

Comments
 (0)