Skip to content

Commit

Permalink
remove react.fc
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoskolodny committed Sep 11, 2024
1 parent cce9c9b commit 19047ae
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/rating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import type {ExclusifyUnion} from './utils/utility-types';
import type {DataAttributes, IconProps} from './utils/types';

type RatingIconProps = {
ActiveIcon: React.FC<IconProps>;
InactiveIcon: React.FC<IconProps>;
ActiveIcon: (props: IconProps) => JSX.Element;
InactiveIcon: (props: IconProps) => JSX.Element;
color: string;
};

Expand Down Expand Up @@ -143,7 +143,7 @@ const useRatingState = ({
return [isControlledByParent ? getValueInRange(value) : currentValue, updateValue];
};

const InternalRating: React.FC<InternalRatingProps> = ({
const InternalRating = ({
icons = DEFAULT_QUALITATIVE_ICONS,
count = DEFAULT_RATING_ICON_COUNT,
icon = DEFAULT_RATING_ICON,
Expand All @@ -159,7 +159,7 @@ const InternalRating: React.FC<InternalRatingProps> = ({
withHalfValue,
'aria-label': ariaLabel,
'aria-labelledby': ariaLabelledBy,
}) => {
}: InternalRatingProps) => {
const {texts} = useTheme();

const defaultQualitativeLabels = [
Expand Down Expand Up @@ -324,15 +324,15 @@ const InternalRating: React.FC<InternalRatingProps> = ({
);
};

export const Rating: React.FC<RatingProps> = ({dataAttributes, ...props}) => (
export const Rating = ({dataAttributes, ...props}: RatingProps): JSX.Element => (
<InternalRating
role="radiogroup"
dataAttributes={{'component-name': 'Rating', ...dataAttributes}}
{...props}
/>
);

export const InfoRating: React.FC<InfoRatingProps> = ({dataAttributes, icon, size, ...props}) => (
export const InfoRating = ({dataAttributes, icon, size, ...props}: InfoRatingProps): JSX.Element => (
<InternalRating
size={size ?? DEFAULT_INFO_RATING_SIZE}
icon={icon ?? DEFAULT_INFO_RATING_ICON}
Expand Down

0 comments on commit 19047ae

Please sign in to comment.