Skip to content

Commit

Permalink
fix: avoid returning undefined for form errors when form does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Dec 18, 2020
1 parent 7cc9ef5 commit 8cce17a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/vee-validate/src/useFormErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { injectWithSelf } from './utils';
* Gives access to all form errors
*/
export function useFormErrors() {
const errors = injectWithSelf(
FormErrorsSymbol,
computed(() => ({}))
);
const errors = injectWithSelf(FormErrorsSymbol);

return errors;
return errors || computed(() => ({}));
}

0 comments on commit 8cce17a

Please sign in to comment.