Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix: remove IntersectionObserver shim (#4808)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhtungdu authored Sep 30, 2021
1 parent 3f7c3e5 commit 618adf6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
3 changes: 1 addition & 2 deletions assets/js/base/hooks/use-position-relative-to-viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import { useRef, useLayoutEffect, useState } from '@wordpress/element';
import { getIntersectionObserver } from '@woocommerce/base-utils';

/** @typedef {import('react')} React */

Expand Down Expand Up @@ -50,7 +49,7 @@ export const usePositionRelativeToViewport = () => {
] = useState( '' );
const referenceElementRef = useRef( null );
const intersectionObserver = useRef(
getIntersectionObserver(
new IntersectionObserver(
( entries ) => {
if ( entries[ 0 ].isIntersecting ) {
setPositionRelativeToViewport( 'visible' );
Expand Down
26 changes: 0 additions & 26 deletions assets/js/base/utils/get-intersection-observer.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/base/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export * from './address';
export * from './shipping-rates';
export * from './legacy-events';
export * from './render-frontend';
export * from './get-intersection-observer';
export * from './get-valid-block-attributes';
export * from './product-data';
export * from './derive-selected-shipping-rates';
Expand Down

0 comments on commit 618adf6

Please sign in to comment.