From 3c559031623649a67825ff47f34512f0eb946861 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 22 Feb 2023 10:14:32 +0700 Subject: fix --- src/core/components/elements/Select/HookFormSelect.jsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/core/components/elements/Select/HookFormSelect.jsx (limited to 'src/core/components/elements/Select') diff --git a/src/core/components/elements/Select/HookFormSelect.jsx b/src/core/components/elements/Select/HookFormSelect.jsx new file mode 100644 index 00000000..45cd89b6 --- /dev/null +++ b/src/core/components/elements/Select/HookFormSelect.jsx @@ -0,0 +1,17 @@ +import ReactSelect from "react-select" + +const HookFormSelect = ({ + field, + ...props +}) => ( + field.onChange(option.value)} + value={field.value ? props.options.find(option => option.value === field.value) : ''} + isDisabled={props.disabled} + {...props} + /> +) + +export default HookFormSelect \ No newline at end of file -- cgit v1.2.3 From f66b12fd1d0b83af0d7230d7b1565fbe00afbe3c Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 22 Feb 2023 11:03:34 +0700 Subject: prettier --- src/core/components/elements/Select/HookFormSelect.jsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/core/components/elements/Select') diff --git a/src/core/components/elements/Select/HookFormSelect.jsx b/src/core/components/elements/Select/HookFormSelect.jsx index 45cd89b6..055a9c68 100644 --- a/src/core/components/elements/Select/HookFormSelect.jsx +++ b/src/core/components/elements/Select/HookFormSelect.jsx @@ -1,17 +1,14 @@ -import ReactSelect from "react-select" +import ReactSelect from 'react-select' -const HookFormSelect = ({ - field, - ...props -}) => ( +const HookFormSelect = ({ field, ...props }) => ( field.onChange(option.value)} - value={field.value ? props.options.find(option => option.value === field.value) : ''} + value={field.value ? props.options.find((option) => option.value === field.value) : ''} isDisabled={props.disabled} {...props} /> ) -export default HookFormSelect \ No newline at end of file +export default HookFormSelect -- cgit v1.2.3