MCPcopy Create free account
hub / github.com/Lobos/react-ui / formatData

Function formatData

src/Tree/Tree.js:88–103  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

86 }
87
88 formatData (data) {
89 let tt = this.props.textTpl;
90 let vt = this.props.valueTpl;
91 let setTpl = function (arr) {
92 arr.forEach((d) => {
93 d.$text = substitute(tt, d);
94 d.$value = substitute(vt, d);
95 d.$key = d.id || d.key || hashcode(`${d.$value}-${d.$text}`);
96 if (d.children) {
97 setTpl(d.children);
98 }
99 });
100 };
101 setTpl(data);
102 this.init(data, this.state.value);
103 }
104
105 initValue (value) {
106 this.init(this.state.data, value);

Callers

nothing calls this directly

Calls 1

setTplFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…