Files
supabase/apps/studio/hooks/misc/useLatest.ts
Gildas Garcia c6fc456910 chore: cleanup duplicate exports studio (#47387)
## Problem

Knip reports many duplicate exports (both named and default). Besides,
we're moving away from default exports and even have an eslint rule to
enforce it on new code.

## Solution

- Cleanup those exports
- Update imports when necessary

No functional changes. If it builds, it's fine
2026-06-29 15:46:16 +02:00

8 lines
166 B
TypeScript

import { useRef } from 'react'
export const useLatest = <T>(value: T): { readonly current: T } => {
const ref = useRef(value)
ref.current = value
return ref
}