diff --git a/.changeset/spicy-shoes-press.md b/.changeset/spicy-shoes-press.md new file mode 100644 index 00000000000..cc1af0c28fe --- /dev/null +++ b/.changeset/spicy-shoes-press.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +Octicons (previously known StyledOcticons) to use React.forwardRef() diff --git a/src/Octicon/Octicon.tsx b/src/Octicon/Octicon.tsx index 8eaa7d37a39..5e331e9a2a9 100644 --- a/src/Octicon/Octicon.tsx +++ b/src/Octicon/Octicon.tsx @@ -6,9 +6,10 @@ import {ComponentProps} from '../utils/types' type StyledOcticonProps = {icon: React.ElementType; color?: string} & IconProps -function Icon({icon: IconComponent, ...rest}: StyledOcticonProps) { - return -} +const Icon = React.forwardRef((props: StyledOcticonProps, ref: React.Ref) => { + const {icon: IconComponent, ...rest} = props + return +}) const Octicon = styled(Icon)` ${({color, sx: sxProp}) => sx({sx: {color, ...sxProp}})}