@crossed/primitive
Version:
A universal & performant styling library for React Native, Next.js & React
18 lines (17 loc) • 441 B
JavaScript
import { cloneElement, forwardRef } from "react";
import { useContext } from "./context";
import { composeRefs } from "@crossed/core";
const LabelInput = forwardRef(
({ children }, ref) => {
const { id, inputRef } = useContext();
return cloneElement(children, {
"ref": composeRefs(inputRef, ref),
"aria-labelledby": `label-${id}`,
id
});
}
);
export {
LabelInput
};
//# sourceMappingURL=LabelInput.js.map