Skip to content

Commit 13105d0

Browse files
authored
Merge pull request #4 from balavishnuvj/fix/object-entries-is-not-function
Fixes: Object entries is not a function in older browsers
2 parents 82015b2 + 13d1d97 commit 13105d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/use-form.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ export default function useNewForm(fieldConfig) {
184184
);
185185
setFormErrors(() => {
186186
const errorWithoutMsg = {};
187-
Object.entries(errorFields).forEach(([fieldName, errorState]) => {
187+
Object.keys(errorFields).forEach((fieldName) => {
188+
const errorState = errorFields[fieldName];
188189
errorWithoutMsg[fieldName] = {
189190
isValid: errorState.isValid,
190191
};

0 commit comments

Comments
 (0)