mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
some logic rewritten in add dialog
This commit is contained in:
11
web/src/utils/usePreviousState.js
Executable file
11
web/src/utils/usePreviousState.js
Executable file
@@ -0,0 +1,11 @@
|
||||
import { useEffect, useRef } from 'react'
|
||||
|
||||
export default function usePreviousState(value) {
|
||||
const ref = useRef(value)
|
||||
|
||||
useEffect(() => {
|
||||
ref.current = value
|
||||
}, [value])
|
||||
|
||||
return ref.current
|
||||
}
|
||||
Reference in New Issue
Block a user