Skip to content

Commit

Permalink
Remove useEvent from components package (WordPress#65388)
Browse files Browse the repository at this point in the history
* Replace imports of `useEvent` with `@wordpress/compose`

* Remove `useEvent` from components package

Co-authored-by: DaniGuardiola <daniguardiola@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people committed Sep 19, 2024
1 parent 2ddd114 commit 56bfef8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 47 deletions.
6 changes: 1 addition & 5 deletions packages/components/src/utils/element-rect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
* WordPress dependencies
*/
import { useLayoutEffect, useRef, useState } from '@wordpress/element';
import { useResizeObserver } from '@wordpress/compose';
/**
* Internal dependencies
*/
import { useEvent } from './hooks/use-event';
import { useEvent, useResizeObserver } from '@wordpress/compose';

/**
* The position and dimensions of an element, relative to its offset parent.
Expand Down
38 changes: 0 additions & 38 deletions packages/components/src/utils/hooks/use-event.ts

This file was deleted.

5 changes: 1 addition & 4 deletions packages/components/src/utils/hooks/use-on-value-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
/**
* WordPress dependencies
*/
import { useEvent } from '@wordpress/compose';
import { useRef, useEffect } from '@wordpress/element';
/**
* Internal dependencies
*/
import { useEvent } from './use-event';

/**
* Context object for the `onUpdate` callback of `useOnValueUpdate`.
Expand Down

0 comments on commit 56bfef8

Please sign in to comment.