more useeffect dependencies fixed
This commit is contained in:
parent
2be08ff3e5
commit
bc0cb9685c
2 changed files with 26 additions and 27 deletions
|
|
@ -30,7 +30,7 @@ export default function Chat({flow, reactFlowInstance }:ChatType) {
|
|||
};
|
||||
useEffect(()=>{
|
||||
updateFlow({..._.cloneDeep(flow),chat:chatHistory})
|
||||
},[saveChat])
|
||||
},[chatHistory, flow, saveChat, updateFlow])
|
||||
useEffect(()=>{
|
||||
setChatHistory(flow.chat)
|
||||
},[flow])
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export default function ExtraSidebar() {
|
|||
const [data, setData] = useState({});
|
||||
const { setTypes} = useContext(typesContext);
|
||||
|
||||
useEffect(() => {
|
||||
async function getTypes():Promise<void>{
|
||||
const initialValue:{[char: string]: string} = {
|
||||
str: "advanced",
|
||||
|
|
@ -38,10 +39,8 @@ export default function ExtraSidebar() {
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getTypes();
|
||||
}, []);
|
||||
}, [setTypes]);
|
||||
|
||||
|
||||
function onDragStart(event: React.DragEvent<any>, data:{type:string,node?:APIClassType}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue