fix key error in Search

This commit is contained in:
Alex Holliday committed 2025-01-28 15:37:49 -08:00
1 parent b410c14d93
commit 067d457b96
1 file changed
+4 -1
@@ -139,7 +139,9 @@ const Search = ({
} }
return filtered; return filtered;
}} }}
getOptionKey={(option) => option.id} getOptionKey={(option) => {
return option._id;
}}
renderOption={(props, option) => { renderOption={(props, option) => {
const { key, ...optionProps } = props; const { key, ...optionProps } = props;
return ( return (
@@ -196,6 +198,7 @@ const Search = ({
}; };
Search.propTypes = { Search.propTypes = {
label: PropTypes.string,
id: PropTypes.string, id: PropTypes.string,
multiple: PropTypes.bool, multiple: PropTypes.bool,
options: PropTypes.array.isRequired, options: PropTypes.array.isRequired,