Skip to content

Commit

Permalink
Add case for empty errors on vaniilla FieldError
Browse files Browse the repository at this point in the history
  • Loading branch information
jho406 committed Nov 26, 2024
1 parent d6cfdc1 commit 103f06f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wrappers/ts/vanilla/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ export const Form = ({
* Please modify this to your liking.
*/
export const FieldError = ({ errorKey }: { errorKey: string | undefined }) => {
if (!errorKey) {
const errors = useContext(ValidationContext)
if (!errorKey || !errors) {
return null
}

const errors = useContext(ValidationContext)
const validationError = errors[errorKey]
const hasErrors = errorKey && validationError

Expand Down

0 comments on commit 103f06f

Please sign in to comment.