diff --git a/components/back-top/index.jsx b/components/back-top/index.jsx index 7450b7b66c..908e4f922f 100644 --- a/components/back-top/index.jsx +++ b/components/back-top/index.jsx @@ -57,13 +57,6 @@ export default class BackTop extends React.Component { }); } - animationEnd = () => { - const scrollTop = getScroll(window, true); - this.setState({ - visible: scrollTop > this.props.visibilityHeight, - }); - } - componentDidMount() { this.scrollEvent = addEventListener(window, 'scroll', this.handleScroll); } @@ -92,17 +85,16 @@ export default class BackTop extends React.Component { }; return ( - -
-
- {children || defaultElement} -
-
+ + { + this.state.visible ? +
+
+ {children || defaultElement} +
+
+ : null + }
); }