parent
f4635d794f
commit
a3470cd844
7 changed files with 43 additions and 12 deletions
@ -0,0 +1,13 @@ |
|||||||
|
import { useRef } from "preact/hooks" |
||||||
|
|
||||||
|
export function useIsFirstRender(): boolean { |
||||||
|
const isFirst = useRef(true) |
||||||
|
|
||||||
|
if (isFirst.current) { |
||||||
|
isFirst.current = false |
||||||
|
|
||||||
|
return true |
||||||
|
} |
||||||
|
|
||||||
|
return isFirst.current |
||||||
|
} |
Loading…
Reference in new issue