Skip to content

Commit 3047051

Browse files
committed
fix compilation error
1 parent f131dd8 commit 3047051

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

admin/src/Components/ProductImageSelect.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import classNames from "classnames/bind";
1+
import classNames from "classnames";
22
import React, { useEffect, useRef, useState } from "react";
33
import Select from "react-select";
44
import { get, post } from "../gateway";
@@ -187,8 +187,13 @@ const ProductImageSelect: React.FC<ProductImageSelectProps> = (props) => {
187187
className="uk-width-1-1"
188188
options={options}
189189
value={currentValue}
190-
getOptionValue={props.getValue}
191-
getOptionLabel={props.getLabel}
190+
getOptionValue={(option) => String(props.getValue(option))}
191+
getOptionLabel={(option) => {
192+
const label = props.getLabel(option);
193+
return typeof label === "string"
194+
? label
195+
: String(label);
196+
}}
192197
onChange={handleSelectChange}
193198
isDisabled={!options.length || uploading}
194199
isLoading={uploading}

0 commit comments

Comments
 (0)