!disabled && mouseLeaveHandler()}>
+ {[...Array(count)].map((_, index) =>
+ showText ? (
+
+ !disabled && mouseEnterHandler(event, index + 1)}
+ onClick={(event) => !disabled && clickHandler(event, index + 1)}
+ style={getStarStyle(index, count, displayValue)}
+ className={`${classPrefix}-rate__wrapper`}
+ >
+ {getStar(allowHalf, index, displayValue)}
+
+
+ ) : (
+
!disabled && mouseEnterHandler(event, index + 1)}
+ onClick={(event) => !disabled && clickHandler(event, index + 1)}
+ style={getStarStyle(index, count, displayValue)}
+ className={`${classPrefix}-rate__wrapper`}
+ >
+ {getStar(allowHalf, index, displayValue)}
+
+ ),
+ )}
+ {showText &&
{texts[displayValue - 1]}
}
+
+ );
+};
+
+Rate.displayName = 'Rate';
+Rate.defaultProps = rateDefaultProps;
+
+export default Rate;
diff --git a/src/rate/__tests__/__snapshots__/rate.test.tsx.snap b/src/rate/__tests__/__snapshots__/rate.test.tsx.snap
new file mode 100644
index 000000000..b44b7b117
--- /dev/null
+++ b/src/rate/__tests__/__snapshots__/rate.test.tsx.snap
@@ -0,0 +1,1208 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Rate 组件测试 count 1`] = `
+