diff --git a/src/component/index.js b/src/component/index.js index 330f320..9b22c0a 100644 --- a/src/component/index.js +++ b/src/component/index.js @@ -44,7 +44,7 @@ const DashedCircle = styled.circle` animation: ${dashed} 1.4s ease-in-out infinite; ` -export default (props, state, children) => { +export default (props, state) => { const { max, yRefreshing, y, phase } = state const { zIndex, color, bgColor } = props const p = Math.atan(y / max) @@ -53,7 +53,7 @@ export default (props, state, children) => { const Svg = phase === 'refreshing' ? RotatingSvg : 'svg' const Circle = phase === 'refreshing' ? DashedCircle : 'circle' const refreshed = phase === 'refreshed' - return [ + return ( { /> } - , - children - ] + + ) } diff --git a/src/index.js b/src/index.js index 0180c99..cf0c3c6 100644 --- a/src/index.js +++ b/src/index.js @@ -106,21 +106,25 @@ export default class PullRefresh extends Component { children, ...props } = this.props + const PullRefreshComponent = render const Container = as return ( - - { render(this.props, this.state, children) } - +
+ + { children } + + { render(this.props, this.state) } +
) } }