()
| 115 | } |
| 116 | |
| 117 | export function useT(): (key: string, options?: Record<string, unknown>) => string { |
| 118 | const { t, i18n } = useTranslation(); |
| 119 | // Memoize keyed on the active language so that `useEffect` dependency |
| 120 | // arrays holding this function only re-run when the locale actually |
| 121 | // changes, not on every render (react-i18next's `t` identity is not |
| 122 | // stable across renders). |
| 123 | // biome-ignore lint/correctness/useExhaustiveDependencies: identity must track locale, not `t`. |
| 124 | return useCallback((key, options) => t(key, options ?? {}) as string, [i18n.language]); |
| 125 | } |
| 126 | |
| 127 | export { useTranslation } from 'react-i18next'; |
| 128 | export { i18next as i18n }; |
no outgoing calls
no test coverage detected