Skip to content

Commit

Permalink
refactor(types): remove remaining I prefix from typescript interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
garthenweb committed Feb 16, 2020
1 parent 3731b1b commit 725caea
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/ObserveViewport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,7 +48,7 @@ interface Context {
version: string;
}

export default class ObserveViewport extends React.Component<IProps, IState> {
export default class ObserveViewport extends React.Component<Props, State> {
private removeViewportChangeListener?: (
handler: ViewportChangeHandler,
) => void;
Expand All @@ -59,22 +59,22 @@ export default class ObserveViewport extends React.Component<IProps, IState> {
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(),
dimensions: createEmptyDimensionState(),
};
}

componentDidUpdate(prevProps: IProps) {
componentDidUpdate(prevProps: Props) {
const dimensionsBecameActive =
!this.props.disableDimensionsUpdates &&
prevProps.disableDimensionsUpdates;
Expand Down

0 comments on commit 725caea

Please sign in to comment.