Skip to content

Commit 8d40e14

Browse files
committed
undo one registry update
1 parent 5ee799d commit 8d40e14

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

frontend/src/components/redpanda-ui/components/code-block-dynamic.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { buttonVariants } from './button';
2929
import { useShiki } from '../lib/use-shiki';
3030
import { cn, type SharedProps } from '../lib/utils';
3131

32-
export function useStableCallback<F extends (...params: never[]) => unknown>(callback: F): F {
32+
export function useEffectEvent<F extends (...params: never[]) => unknown>(callback: F): F {
3333
const ref = useRef(callback);
3434
ref.current = callback;
3535

@@ -40,7 +40,7 @@ export function useCopyButton(onCopy: () => void | Promise<void>): [checked: boo
4040
const [checked, setChecked] = useState(false);
4141
const timeoutRef = useRef<number | null>(null);
4242

43-
const onClick: MouseEventHandler = useStableCallback(() => {
43+
const onClick: MouseEventHandler = useEffectEvent(() => {
4444
if (timeoutRef.current) {
4545
window.clearTimeout(timeoutRef.current);
4646
}
@@ -293,6 +293,8 @@ export function DynamicCodeBlock({
293293

294294
return (
295295
<>
296+
{/* React 19 stylesheet hoisting props (href, precedence) — not yet typed in @types/react@18. */}
297+
{/* @ts-expect-error remove once React types are upgraded to 19 */}
296298
<style href="shiki-dual-theme" precedence="medium">
297299
{shikiDualThemeStyles}
298300
</style>

0 commit comments

Comments
 (0)