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

Method setValue

src/CheckboxGroup.js:33–44  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

31 }
32
33 setValue (value) {
34 value = toArray(value, this.props.sep);
35 if (this.state) {
36 let data = this.state.data.map((d) => {
37 d.$checked = value.indexOf(d.$value) >= 0;
38 return d;
39 });
40 this.setState({ value, data });
41 } else {
42 this.setState({ value });
43 }
44 }
45
46 formatData (data, value=this.state.value) {
47 data = toTextValue(data, this.props.textTpl, this.props.valueTpl).map((d) => {

Callers 1

Calls 1

toArrayFunction · 0.90

Tested by

no test coverage detected