MCPcopy
hub / github.com/gcanti/tcomb-form-native / getError

Method getError

lib/components.js:169–183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167 }
168
169 getError() {
170 if (this.hasError()) {
171 const error =
172 this.props.options.error || this.typeInfo.getValidationErrorMessage;
173 if (t.Function.is(error)) {
174 const validationOptions = this.getValidationOptions();
175 return error(
176 this.getValue(),
177 validationOptions.path,
178 validationOptions.context
179 );
180 }
181 return error;
182 }
183 }
184
185 hasError() {
186 return this.props.options.hasError || this.state.hasError;

Callers 1

getLocalsMethod · 0.95

Calls 3

hasErrorMethod · 0.95
getValidationOptionsMethod · 0.95
getValueMethod · 0.95

Tested by

no test coverage detected