Skip to content

Commit

Permalink
fix(rate): resolve displayTexts empty (#3060)
Browse files Browse the repository at this point in the history
* fix(rate): resolve displayTexts  empty

* chore: update snapshot

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
liweijie0812 and github-actions[bot] authored Aug 23, 2024
1 parent 8e37532 commit f360958
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/rate/Rate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Rate = React.forwardRef<HTMLDivElement, RateProps>((originalProps, ref) =>
const { allowHalf, color, count, disabled, gap, showText, size, icon, className, style, onChange, texts } = props;
const [locale, t] = useLocaleReceiver('rate');

const displayTexts = texts || t(locale.rateText);
const displayTexts = texts.length ? texts : t(locale.rateText);

const { classPrefix } = useConfig();
const [starValue = 0, setStarValue] = useControlled(props, 'value', onChange);
Expand Down
Loading

0 comments on commit f360958

Please sign in to comment.