From 7cf74e733b09232d0b918839792da3d287745d24 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 21 Jun 2024 16:06:08 -0300 Subject: [PATCH] make onChange updatable --- src/frontend/src/shared/components/textOutputView/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/shared/components/textOutputView/index.tsx b/src/frontend/src/shared/components/textOutputView/index.tsx index 4e8d24ba5..8ac35877d 100644 --- a/src/frontend/src/shared/components/textOutputView/index.tsx +++ b/src/frontend/src/shared/components/textOutputView/index.tsx @@ -1,6 +1,6 @@ import { Textarea } from "../../../components/ui/textarea"; -const TextOutputView = ({ left, value,onChange }) => { +const TextOutputView = ({ left, value,onChange }:{left:boolean|undefined,value:any,onChange?:(string)=>void;}) => { if (typeof value === "object" && Object.keys(value).includes("text")) { value = value.text; } @@ -10,7 +10,7 @@ const TextOutputView = ({ left, value,onChange }) => { placeholder={"Empty"} // update to real value on flowPool value={value} - onChange={(e) => onChange(e.target.value)} + onChange={(e) => {if(onChange) onChange(e.target.value)}} /> ); };