Skip to content

Commit ed4e716

Browse files
authored
Mirror src/index
1 parent cc6615d commit ed4e716

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

sandbox/src/src/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ const sidesArray = ['left', 'right', 'top', 'bottom'] as const;
5454
/** Generates a sufficiently unique suffix to add to gradient ids and prevent collisions. */
5555
const generateGradientIdSuffix = (() => {
5656
let shadowGradientIdCounter = 0;
57-
return () => {
58-
shadowGradientIdCounter = (shadowGradientIdCounter + 1) % Number.MAX_SAFE_INTEGER;
59-
return new String(shadowGradientIdCounter);
60-
};
57+
return () => String(shadowGradientIdCounter++)
6158
})();
6259

6360

@@ -186,7 +183,7 @@ export const Shadow: React.FC<ShadowProps> = ({
186183

187184
const [childWidth, setChildWidth] = useState<number | undefined>();
188185
const [childHeight, setChildHeight] = useState<number | undefined>();
189-
const [gradientIdSuffix] = useState<String>(generateGradientIdSuffix());
186+
const [gradientIdSuffix] = useState<string>(generateGradientIdSuffix);
190187

191188
/** Defaults to true if offset is defined, else defaults to false */
192189
const paintInside = paintInsideProp ?? (offset ? true : false);

0 commit comments

Comments
 (0)