Skip to content

Commit 77c6897

Browse files
committed
Use shortid over uniqueDomId
1 parent d0c07fb commit 77c6897

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,8 @@
5252
"react-dom": "^15.4.2",
5353
"webpack": "^2.2.1",
5454
"webpack-stream": "^3.2.0"
55+
},
56+
"dependencies": {
57+
"shortid": "^2.2.6"
5558
}
5659
}

src/js/Tree.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
2+
import shortid from 'shortid';
23

34
import TreeNode from './TreeNode';
45
import nodeShape from './nodeShape';
5-
import uniqueDomId from './uniqueDomId';
66

77
class Tree extends React.Component {
88
static propTypes = {
@@ -42,7 +42,7 @@ class Tree extends React.Component {
4242
this.onCheck = this.onCheck.bind(this);
4343
this.onExpand = this.onExpand.bind(this);
4444

45-
this.id = uniqueDomId('rct');
45+
this.id = `rct-${shortid.generate()}`;
4646
}
4747

4848
onCheck(node) {

src/js/uniqueDomId.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)