Skip to content

Commit

Permalink
feat: added types for class prefix component (#13866)
Browse files Browse the repository at this point in the history
* feat: added types for class prefix component

* fix: linting error

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
SunnyJohal and kodiakhq[bot] authored May 24, 2023
1 parent dc3f74f commit e3b3a83
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@
*/

import PropTypes from 'prop-types';
import React from 'react';
import React, { PropsWithChildren } from 'react';
import { PrefixContext } from '../../internal/usePrefix';

function ClassPrefix({ children, prefix }) {
interface ClassPrefixProps {
/**
* The value used to prefix the CSS selectors
* used by Carbon components.
*/
prefix: string;
}

function ClassPrefix({
children,
prefix,
}: PropsWithChildren<ClassPrefixProps>) {
return (
<PrefixContext.Provider value={prefix}>{children}</PrefixContext.Provider>
);
Expand Down

0 comments on commit e3b3a83

Please sign in to comment.