Skip to content

Commit 6364d38

Browse files
avocadowastakenerikras
authored andcommitted
fix(useField): Guard that event exist in onChange callback. (#19)
1 parent 9bd8fee commit 6364d38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useField.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const subscriptionToInputs = subscription =>
1010
fieldSubscriptionItems.map(key => Boolean(subscription[key]))
1111

1212
const eventValue = event => {
13-
if (!event.target) {
13+
if (!event || !event.target) {
1414
return event
1515
} else if (['checkbox', 'radio'].includes(event.target.type)) {
1616
return event.target.checked

0 commit comments

Comments
 (0)