diff --git a/package.json b/package.json index a71445ea..ee431bcc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stated-form-bean", - "version": "0.1.0-beta.4", + "version": "0.1.0-beta.5", "description": "", "main": "dist/cjs", "module": "dist/es", diff --git a/src/core/FormModel.ts b/src/core/FormModel.ts index 35163249..d930c35d 100644 --- a/src/core/FormModel.ts +++ b/src/core/FormModel.ts @@ -26,10 +26,7 @@ export class FormModel { } validate( - this: FormModel & - Values & { - [ForceUpdate]: (field: T) => void; - }, + this: FormModel & Values, field: T, schema?: yup.Schema, ): Promise { @@ -38,7 +35,8 @@ export class FormModel { } const formField = this[fields][field]; - const self = this; + const self = this as FormModel & + Values & { [ForceUpdate]: (field: T) => void }; return formField.validate(self[field], schema).then(valid => { if (Object.prototype.hasOwnProperty.call(self, ForceUpdate)) { self[ForceUpdate](field);