Migrate Traefik Proxy dashboard UI to React
This commit is contained in:
parent
4790e4910f
commit
f16fff577a
324 changed files with 28303 additions and 19567 deletions
13
webui/src/hooks/use-previous.tsx
Normal file
13
webui/src/hooks/use-previous.tsx
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { useEffect, useRef } from 'react'
|
||||
|
||||
function usePrevious<T>(value: T): T | undefined {
|
||||
const ref = useRef<T>()
|
||||
|
||||
useEffect(() => {
|
||||
ref.current = value
|
||||
}, [value])
|
||||
|
||||
return ref.current
|
||||
}
|
||||
|
||||
export default usePrevious
|
||||
Loading…
Add table
Add a link
Reference in a new issue