mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
* Added screen reader CSS * Added description to external links * Added spinner icon accessibility * Added accessibility to exclamation and big message * Added question and exclamation accessibility * Hide decorative icons * Standardized link design * Added a11y to refresh icons * Added aria-label to anchors and buttons * Added a11y to conditional icons * Added applicable labels to Ant Icons * Changed escape to interpolation * Replaced external links with opens in new tab * Improved Tooltip hosts * Added aria live to temporary elements * Removed mistakenly added redundant helper * Undoes unnecessarily added interpolation * Replaced empty label with hidden * Improved full icon label * Improved display of live regions * Added note * remove unused class * Created unique id * Remove TODOs * Proper action label * Improved feedback for autocomplete toggle * feature: add id hook * refactor: use id hook * standardize white space
12 lines
256 B
TypeScript
12 lines
256 B
TypeScript
import { useRef } from "react";
|
|
|
|
export function useLazyRef<T>(getInitialValue: () => T) {
|
|
const lazyRef = useRef<T>(null) as React.MutableRefObject<T>;
|
|
|
|
if (lazyRef.current === null) {
|
|
lazyRef.current = getInitialValue();
|
|
}
|
|
|
|
return lazyRef;
|
|
}
|