import type { RefObject } from "preact"; /** * Takes in a React ref and returns a corresponding JQuery selector. * * @param ref the React ref from which to obtain the jQuery selector. * @returns the corresponding jQuery selector. */ export function refToJQuerySelector(ref: RefObject | null): JQuery { if (ref?.current) { return $(ref.current); } else { return $(); } }