UNPKG

@carbon/react

Version:

React components for the Carbon Design System

31 lines (26 loc) 700 B
/** * Copyright IBM Corp. 2016, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; var PropTypes = require('prop-types'); var React = require('react'); var usePrefix = require('../../internal/usePrefix.js'); function ClassPrefix({ children, prefix }) { return /*#__PURE__*/React.createElement(usePrefix.PrefixContext.Provider, { value: prefix }, children); } ClassPrefix.propTypes = { children: PropTypes.node, /** * The value used to prefix the CSS selectors used by Carbon components */ prefix: PropTypes.string.isRequired }; exports.ClassPrefix = ClassPrefix;