source:
imaps-frontend/node_modules/react-use/esm/useFirstMountState.js@
d565449
Last change on this file since d565449 was d565449, checked in by , 4 weeks ago | |
---|---|
|
|
File size: 220 bytes |
Rev | Line | |
---|---|---|
[d565449] | 1 | import { useRef } from 'react'; |
2 | export function useFirstMountState() { | |
3 | var isFirst = useRef(true); | |
4 | if (isFirst.current) { | |
5 | isFirst.current = false; | |
6 | return true; | |
7 | } | |
8 | return isFirst.current; | |
9 | } |
Note:
See TracBrowser
for help on using the repository browser.