Skip to content

Commit 7452dc7

Browse files
cryptoadsjstejada
authored andcommitted
Changed random timestamp used for props.key (#58)
* Changed random timestamp used for props.key * change request: node-sass reverted to older version * using Original package.json and yarn.lock
1 parent 4d16636 commit 7452dc7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ export function extractTextFromElement(element) {
7171
export function cloneElement(element, children) {
7272
const tag = element.type;
7373
const props = exclude(element.props, ['children']);
74+
const getMilliseconds = new Date().getUTCMilliseconds();
75+
const randomStamp = getMilliseconds + Math.random() + Math.random();
7476
// eslint-disable-next-line
75-
props.key = `Typist-element-${tag}-${Date.now() + Math.random() + Math.random()}`;
77+
props.key = `Typist-element-${tag}-${randomStamp}`;
7678
return React.createElement(tag, props, ...children);
7779
}
7880

0 commit comments

Comments
 (0)