some logic rewritten in add dialog

This commit is contained in:
Daniel Shleifman
2021-06-10 21:16:20 +03:00
parent 33ee3c4fb6
commit bb6ec852b0
2 changed files with 70 additions and 32 deletions

View 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
}