Skip to content

Commit

Permalink
Changed random timestamp used for props.key (#58)
Browse files Browse the repository at this point in the history
* Changed random timestamp used for props.key

* change request: node-sass reverted to older version

* using Original package.json and yarn.lock
  • Loading branch information
cryptoads authored and jstejada committed Jan 2, 2019
1 parent 4d16636 commit 7452dc7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ export function extractTextFromElement(element) {
export function cloneElement(element, children) {
const tag = element.type;
const props = exclude(element.props, ['children']);
const getMilliseconds = new Date().getUTCMilliseconds();
const randomStamp = getMilliseconds + Math.random() + Math.random();
// eslint-disable-next-line
props.key = `Typist-element-${tag}-${Date.now() + Math.random() + Math.random()}`;
props.key = `Typist-element-${tag}-${randomStamp}`;
return React.createElement(tag, props, ...children);
}

Expand Down

0 comments on commit 7452dc7

Please sign in to comment.