mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-20 14:06:09 +05:00
12 lines
204 B
JavaScript
Executable File
12 lines
204 B
JavaScript
Executable File
import { useEffect, useRef } from 'react'
|
|
|
|
export default function usePreviousState(value) {
|
|
const ref = useRef(value)
|
|
|
|
useEffect(() => {
|
|
ref.current = value
|
|
}, [value])
|
|
|
|
return ref.current
|
|
}
|