import React, { useEffect } from "react"; import { BooleanSwitch } from "../../BooleanSwitch"; export function VirtualTableSwitch(props: { error?: Error; internalValue?: boolean; focused: boolean; disabled: boolean; updateValue: (newValue: (boolean | null)) => void; }) { const { internalValue, updateValue, focused } = props; const ref = React.useRef(null); useEffect(() => { if (ref.current && focused) { ref.current.focus({ preventScroll: true }); } }, [focused, ref]); return ( ); }