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

Function setValue

src/Select.js:106–119  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

104 }
105
106 setValue (value) {
107 value = toArray(value, this.props.mult ? this.props.sep : null);
108 if (this.state) {
109 let data = this.state.data.map((d) => {
110 if (typeof d !== 'string') {
111 d.$checked = value.indexOf(d.$value) >= 0;
112 }
113 return d;
114 });
115 this.setState({ value, data });
116 } else {
117 this.setState({ value });
118 }
119 }
120
121 formatData (data, value = this.state.value) {
122 if (!Array.isArray(data)) {

Callers

nothing calls this directly

Calls 1

toArrayFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…