diff --git a/packages/components/src/utils/index.js b/packages/components/src/utils/index.js index b903874d95f32a..94d8a67cc04607 100644 --- a/packages/components/src/utils/index.js +++ b/packages/components/src/utils/index.js @@ -1,3 +1,2 @@ export * from './hooks'; export * from './style-mixins'; -export * from './use-update-effect'; diff --git a/packages/components/src/utils/use-update-effect.js b/packages/components/src/utils/use-update-effect.js deleted file mode 100644 index c7dfab9452daef..00000000000000 --- a/packages/components/src/utils/use-update-effect.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * WordPress dependencies - */ -import { useRef, useEffect } from '@wordpress/element'; - -/* - * A `React.useEffect` that will not run on the first render. - * Source: - * https://github.com/reakit/reakit/blob/master/packages/reakit-utils/src/useUpdateEffect.ts - */ -export function useUpdateEffect( effect, deps ) { - const mounted = useRef( false ); - - useEffect( () => { - if ( mounted.current ) { - return effect(); - } - mounted.current = true; - return undefined; - }, deps ); -}