mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
10 lines
185 B
TypeScript
10 lines
185 B
TypeScript
import { useRef } from 'react'
|
|
|
|
const useLatest = <T>(value: T): { readonly current: T } => {
|
|
const ref = useRef(value)
|
|
ref.current = value
|
|
return ref
|
|
}
|
|
|
|
export default useLatest
|