Skip to content

Commit d453bbd

Browse files
authored
fix: ensure copy btns are created after hydration (#165)
1 parent 9605c65 commit d453bbd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/ui/utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useLocation } from "react-router";
21
import { useEffect, useState } from "react";
32

43
let hydrating = true;
@@ -15,7 +14,6 @@ export function useHydrated() {
1514
export function useCodeBlockCopyButton(
1615
ref: React.RefObject<HTMLElement | null>
1716
) {
18-
let location = useLocation();
1917
useEffect(() => {
2018
let container = ref.current;
2119
if (!container) return;
@@ -72,5 +70,5 @@ export function useCodeBlockCopyButton(
7270
window.clearTimeout(props.to);
7371
}
7472
};
75-
}, [ref, location.pathname]);
73+
});
7674
}

0 commit comments

Comments
 (0)