Commit 7abf2bfe authored by 李勇諭's avatar 李勇諭

fix server render broken

parent 043480c5
/.idea
/node_modules /node_modules
/public /public
/src /src
......
...@@ -16,17 +16,18 @@ export interface PullToRefreshState { ...@@ -16,17 +16,18 @@ export interface PullToRefreshState {
} }
export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRefreshState> { export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRefreshState> {
private container: HTMLElement; private container: any;
@autobind @autobind
private containerRef(container: HTMLElement) { private containerRef(container) {
this.container = container; this.container = container;
} }
private pullDown: HTMLElement; private pullDown: any;
@autobind @autobind
private pullDownRef(pullDown: HTMLElement) { private pullDownRef(pullDown) {
this.pullDown = pullDown; this.pullDown = pullDown;
const maxPullDownDistance = this.pullDown.firstChild["getBoundingClientRect"]().height; const maxPullDownDistance = this.pullDown && this.pullDown.firstChild && this.pullDown.firstChild["getBoundingClientRect"]
? this.pullDown.firstChild["getBoundingClientRect"]().height : 0;
this.setState({maxPullDownDistance}); this.setState({maxPullDownDistance});
} }
......
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