Fix linter complaints
* In JsonView.tsx - add setCopied to dependencies of handleCopy useCallback * In useCopy.ts - add timeout to useEffect inside useCopy hook
This commit is contained in:
parent
b025bffc9d
commit
4e90143071
2 changed files with 2 additions and 2 deletions
|
|
@ -51,7 +51,7 @@ const JsonView = memo(
|
|||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
}, [toast, normalizedData]);
|
||||
}, [toast, normalizedData, setCopied]);
|
||||
|
||||
return (
|
||||
<div className={clsx("p-4 border rounded relative", className)}>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ function useCopy({ timeout = 500 }: UseCopyProps = {}) {
|
|||
clearTimeout(timeoutId);
|
||||
}
|
||||
};
|
||||
}, [copied]);
|
||||
}, [copied, timeout]);
|
||||
|
||||
return { copied, setCopied };
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue