mirror of
https://github.com/zoo-labs/zoo.git
synced 2026-11-10 22:32:34 +00:00
10 lines
219 B
TypeScript
10 lines
219 B
TypeScript
import { useRef } from 'react'
|
|
|
|
function useStickyData<T>(value: T | undefined) {
|
|
const val = useRef<T | null>(null)
|
|
if (value !== undefined) val.current = value
|
|
return val.current
|
|
}
|
|
|
|
export default useStickyData
|