Skip to content

Commit

Permalink
fix(ui): timer type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Nov 1, 2024
1 parent a8e0ef7 commit ec67606
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const CodeBlock = ({
...props
}: CodeBlockProps) => {
const [isCopied, setIsCopied] = useState(false)
const timeoutRef = React.useRef<NodeJS.Timeout | null>(null)
const timeoutRef = React.useRef<number | null>(null)

React.useEffect(() => {
return () => {
Expand All @@ -141,7 +141,7 @@ export const CodeBlock = ({
if (timeoutRef.current) {
clearTimeout(timeoutRef.current) // clear any possibly existing Refs
}
timeoutRef.current = setTimeout(() => setIsCopied(false), 1000)
timeoutRef.current = window.setTimeout(() => setIsCopied(false), 1000)
}, [content, children, lang])

return (
Expand Down

0 comments on commit ec67606

Please sign in to comment.