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

Method bindToForm

src/higherOrders/FormItem.js:85–104  ·  view source on GitHub ↗
(props, value)

Source from the content-addressed store, hash-verified

83 }
84
85 bindToForm (props, value) {
86 const { name, validator, ignore, itemBind } = props;
87 this.id = nextUid();
88 let valiBind;
89 if (validator && validator.bind) {
90 valiBind = validator.bind;
91 if (typeof valiBind === 'string') {
92 valiBind = [valiBind];
93 }
94 }
95
96 itemBind({
97 id: this.id,
98 name,
99 valiBind,
100 ignore,
101 value,
102 validate: this.validate.bind(this)
103 });
104 }
105
106 validate (value = this.state.value, props = this.props) {
107 let { onValidate, ...other } = props;

Callers 2

componentWillMountMethod · 0.95

Calls 1

nextUidFunction · 0.90

Tested by

no test coverage detected