File tree Expand file tree Collapse file tree
frontend/src/components/redpanda-ui/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ import { buttonVariants } from './button';
2929import { useShiki } from '../lib/use-shiki' ;
3030import { 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 >
You can’t perform that action at this time.
0 commit comments