Commit 9310e0f0 authored by AFOC-1709091830\echou's avatar AFOC-1709091830\echou

refactor

parent 951c7386
......@@ -2,7 +2,7 @@ import * as React from "react";
import styled from "styled-components";
export interface PullDownContentProps {
height?: number;
height?: string;
background?: any;
label?: string;
}
......
......@@ -51,6 +51,10 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
}
public componentDidMount(): void {
if (!this.container) {
return;
}
this.container.addEventListener("touchstart", this.onTouchStart);
this.container.addEventListener("touchmove", this.onTouchMove);
this.container.addEventListener("touchend", this.onEnd);
......@@ -60,6 +64,10 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
}
public componentWillUnmount(): void {
if (!this.container) {
return;
}
this.container.removeEventListener("touchstart", this.onTouchStart);
this.container.removeEventListener("touchmove", this.onTouchMove);
this.container.removeEventListener("touchend", this.onEnd);
......
......@@ -2,7 +2,7 @@ import * as React from "react";
import styled from "styled-components";
export interface RefreshContentProps {
height?: number;
height?: string;
background?: any;
}
......
......@@ -2,7 +2,7 @@ import * as React from "react";
import styled from "styled-components";
export interface ReleaseContentProps {
height?: number;
height?: string;
background?: any;
label?: string;
}
......
import {PullToRefresh} from "./PullToRefresh";
import {PullToRefresh} from "./components/PullToRefresh";
import {RefreshContent} from "./components/RefreshContent";
import {PullDownContent} from "./components/PullDownContent";
import {ReleaseContent} from "./components/ReleaseContent";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment