main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
332 bytes
|
Line | |
---|
1 | import { useEffect } from 'react';
|
---|
2 | import { useFirstMountState } from './useFirstMountState';
|
---|
3 | var useUpdateEffect = function (effect, deps) {
|
---|
4 | var isFirstMount = useFirstMountState();
|
---|
5 | useEffect(function () {
|
---|
6 | if (!isFirstMount) {
|
---|
7 | return effect();
|
---|
8 | }
|
---|
9 | }, deps);
|
---|
10 | };
|
---|
11 | export default useUpdateEffect;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.