Skip to content

Commit 4eb4748

Browse files
committed
better label when component is selected
1 parent e2b020a commit 4eb4748

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/connect-react/src/components/SelectComponent.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useId, useEffect } from "react";
1+
import { useId } from "react";
22
import Select from "react-select";
33
import { useComponents } from "../hooks/use-components";
44
import { AppResponse, V1Component } from "@pipedream/sdk";
@@ -22,6 +22,8 @@ export function SelectComponent({
2222
componentType,
2323
});
2424

25+
const selectedValue = components?.find((c) => c.key === value?.key) || null;
26+
2527
return (
2628
<Select
2729
instanceId={instanceId}
@@ -30,7 +32,7 @@ export function SelectComponent({
3032
options={components}
3133
getOptionLabel={(o) => o.name || o.key}
3234
getOptionValue={(o) => o.key}
33-
value={value}
35+
value={selectedValue}
3436
onChange={(o) => onChange?.((o as V1Component) || undefined)}
3537
isLoading={isLoading}
3638
components={{

0 commit comments

Comments
 (0)