Skip to content
This repository was archived by the owner on Jan 14, 2021. It is now read-only.

Commit 925bd6e

Browse files
committed
fix react select
1 parent 2e32716 commit 925bd6e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { useFormContext } from 'react-hook-form';
33
import { Props, EventFunction } from './types';
44

55
function getValue(target: any, { isCheckbox }: { isCheckbox: boolean }) {
6-
if (Array.isArray(target)) {
6+
// the following logic is specific for react-select
7+
if (Array.isArray(target) || (target.label && target.value)) {
78
return target;
89
}
910
return target ? (isCheckbox ? target.checked : target.value) : target;

0 commit comments

Comments
 (0)