@coxy/react-validator 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ class ValidationFieldWrapper extends react_1.Component {
14
14
  }
15
15
  validate() {
16
16
  const props = this.props;
17
- const customError = props.customErrors.find((item) => item.id === props.id);
17
+ const customError = (props.customErrors || []).find((item) => item.id === props.id);
18
18
  if (customError) {
19
19
  return customError;
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coxy/react-validator",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "🚀 Simple validation form for React or NodeJS apps. useValidator are included ;)",
5
5
  "main": "./dist/index.js",
6
6
  "repository": {
@@ -31,7 +31,7 @@ class ValidationFieldWrapper extends Component<Props> {
31
31
 
32
32
  validate(): Validity {
33
33
  const props = this.props
34
- const customError = props.customErrors.find((item) => item.id === props.id)
34
+ const customError = (props.customErrors || []).find((item) => item.id === props.id)
35
35
  if (customError) {
36
36
  return customError
37
37
  }