UNPKG

react-bootstrap-v5

Version:

Bootstrap 4 components built with React

24 lines (22 loc) 989 B
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import classNames from 'classnames'; import React, { useContext } from 'react'; import FormContext from './FormContext'; import { useBootstrapPrefix } from './ThemeProvider'; var FormCheckLabel = React.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, htmlFor = _ref.htmlFor, props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "htmlFor"]); var _useContext = useContext(FormContext), controlId = _useContext.controlId; bsPrefix = useBootstrapPrefix(bsPrefix, 'form-check-label'); return /*#__PURE__*/React.createElement("label", _extends({}, props, { ref: ref, htmlFor: htmlFor || controlId, className: classNames(className, bsPrefix) })); }); FormCheckLabel.displayName = 'FormCheckLabel'; export default FormCheckLabel;