diff --git a/samples/react-calendar-feed/package-lock.json b/samples/react-calendar-feed/package-lock.json index e92ca3c3a..17fe2a7a9 100644 --- a/samples/react-calendar-feed/package-lock.json +++ b/samples/react-calendar-feed/package-lock.json @@ -4878,11 +4878,6 @@ "integrity": "sha512-NsEzBVa5aMgn/n79piyJtpUQFzJ97tB2R2r8PSJlLnMA6LJmchKuv7ATN+/nZH/3QRd/+uFXEq07/i/ajsqVGQ==", "dev": true }, - "@rehooks/component-size": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@rehooks/component-size/-/component-size-1.0.3.tgz", - "integrity": "sha512-pnYld+8SSF2vXwdLOqBGUyOrv/SjzwLjIUcs/4c1JJgR0q4E9eBtBfuZMD6zUD51fvSehSsbnlQMzotSmPTXPg==" - }, "@types/adal-angular": { "version": "1.0.1", "resolved": "http://registry.npmjs.org/@types/adal-angular/-/adal-angular-1.0.1.tgz", diff --git a/samples/react-calendar-feed/package.json b/samples/react-calendar-feed/package.json index 1a97a4811..3b811f9b6 100644 --- a/samples/react-calendar-feed/package.json +++ b/samples/react-calendar-feed/package.json @@ -23,7 +23,6 @@ "@pnp/sp": "^1.2.8", "@pnp/spfx-controls-react": "^1.11.0", "@pnp/spfx-property-controls": "^1.13.1", - "@rehooks/component-size": "^1.0.3", "@types/es6-promise": "0.0.33", "@types/react": "16.8.8", "@types/react-dom": "16.8.3", diff --git a/samples/react-calendar-feed/src/shared/components/filmstripLayout/FilmstripLayout.tsx b/samples/react-calendar-feed/src/shared/components/filmstripLayout/FilmstripLayout.tsx index 4dc6580a8..133261bcd 100644 --- a/samples/react-calendar-feed/src/shared/components/filmstripLayout/FilmstripLayout.tsx +++ b/samples/react-calendar-feed/src/shared/components/filmstripLayout/FilmstripLayout.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import Slider from 'react-slick'; import { SPComponentLoader } from '@microsoft/sp-loader'; import styles from "./FilmstripLayout.module.scss"; -import { useRef,useLayoutEffect, useState } from 'react'; +import { useRef } from 'react'; function useBreakpoints(currentWidth: number, breakpoints: number[]) { return breakpoints.map(breakpoint => currentWidth < breakpoint); @@ -15,20 +15,7 @@ function useBreakpoints(currentWidth: number, breakpoints: number[]) { * Presents the child compoments as a slick slide */ export const FilmstripLayout = (props: { children: any; clientWidth: number; ariaLabel?: string; }) => { - function useWindowSize() { - const [size, setSize] = useState([0, 0]); - useLayoutEffect(() => { - function updateSize() { - setSize([window.innerWidth, window.innerHeight]); - } - window.addEventListener('resize', updateSize); - updateSize(); - return () => window.removeEventListener('resize', updateSize); - }, []); - return size; - } - const [width, height] = useWindowSize(); let ref: React.MutableRefObject = useRef(null); // // the slick slider used in normal views let _slider: React.MutableRefObject = useRef(null); @@ -76,7 +63,6 @@ export const FilmstripLayout = (props: { children: any; clientWidth: number; ari return (
- WIDTH: { width }
{props.children}