diff --git a/src/components/Radio/Item.jsx b/src/components/Radio/Item.jsx index 95426be1b..2d2f4538b 100644 --- a/src/components/Radio/Item.jsx +++ b/src/components/Radio/Item.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { forwardRef } from "react"; import classnames from "classnames"; import PropTypes from "prop-types"; @@ -7,37 +7,42 @@ import Label from "components/Label"; import { useId } from "hooks"; import { hyphenize } from "utils"; -const Item = ({ - name = "", - label = "", - className = "", - labelProps, - dataCy = "", - ...otherProps -}) => { - const id = useId(otherProps.id); +const Item = forwardRef( + ( + { + name = "", + label = "", + className = "", + labelProps, + dataCy = "", + ...otherProps + }, + ref + ) => { + const id = useId(otherProps.id); - return ( -
- - {label && ( - - )} -
- ); -}; + return ( +
+ + {label && ( + + )} +
+ ); + } +); Item.displayName = "Radio.Item";