From 725caea66fc8d51cb1de7ace30884011a9bd7f70 Mon Sep 17 00:00:00 2001 From: Jannick Garthen Date: Sun, 16 Feb 2020 13:58:00 +0100 Subject: [PATCH] refactor(types): remove remaining I prefix from typescript interfaces --- lib/ObserveViewport.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/ObserveViewport.tsx b/lib/ObserveViewport.tsx index 61f26a5..98dd88b 100644 --- a/lib/ObserveViewport.tsx +++ b/lib/ObserveViewport.tsx @@ -19,17 +19,17 @@ import { cancelAnimationFrame, } from './utils'; -export interface IChildProps { +interface ChildProps { scroll: Scroll | null; dimensions: Dimensions | null; } -interface IState extends IChildProps {} +interface State extends ChildProps {} -interface IProps { - children?: (props: IChildProps) => React.ReactNode; - onUpdate?: (props: IChildProps, layoutSnapshot: unknown) => void; - recalculateLayoutBeforeUpdate?: (props: IChildProps) => unknown; +interface Props { + children?: (props: ChildProps) => React.ReactNode; + onUpdate?: (props: ChildProps, layoutSnapshot: unknown) => void; + recalculateLayoutBeforeUpdate?: (props: ChildProps) => unknown; disableScrollUpdates: boolean; disableDimensionsUpdates: boolean; deferUpdateUntilIdle: boolean; @@ -48,7 +48,7 @@ interface Context { version: string; } -export default class ObserveViewport extends React.Component { +export default class ObserveViewport extends React.Component { private removeViewportChangeListener?: ( handler: ViewportChangeHandler, ) => void; @@ -59,14 +59,14 @@ export default class ObserveViewport extends React.Component { private tickId?: number; private nextViewport?: Viewport; - static defaultProps: IProps = { + static defaultProps: Props = { disableScrollUpdates: false, disableDimensionsUpdates: false, deferUpdateUntilIdle: false, priority: 'normal', }; - constructor(props: IProps) { + constructor(props: Props) { super(props); this.state = { scroll: createEmptyScrollState(), @@ -74,7 +74,7 @@ export default class ObserveViewport extends React.Component { }; } - componentDidUpdate(prevProps: IProps) { + componentDidUpdate(prevProps: Props) { const dimensionsBecameActive = !this.props.disableDimensionsUpdates && prevProps.disableDimensionsUpdates;