|
|
@@ -1,42 +0,0 @@
|
|
|
-import React from "react";
|
|
|
-import { ScrollView, RefreshControl } from "react-native";
|
|
|
-
|
|
|
-function scrollPage(Component) {
|
|
|
- class NewPage extends React.Component {
|
|
|
- constructor(props) {
|
|
|
- super(props);
|
|
|
- this.state = {
|
|
|
- refreshing: false,
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
- _onRefresh = () => {
|
|
|
- this.setState({ refreshing: true });
|
|
|
- fetchData().then(() => {
|
|
|
- this.setState({ refreshing: false });
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- render(props) {
|
|
|
- return (
|
|
|
- <ScrollView
|
|
|
- contentContainerStyle={{ flexGrow: 1 }}
|
|
|
- refreshControl={
|
|
|
- <RefreshControl
|
|
|
- refreshing={this.state.refreshing}
|
|
|
- onRefresh={this._onRefresh}
|
|
|
- enabled={true}
|
|
|
- />
|
|
|
- }
|
|
|
- >
|
|
|
- <Component {...props} />
|
|
|
- </ScrollView>
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- return () => {
|
|
|
- return <NewPage />;
|
|
|
- };
|
|
|
-}
|
|
|
-
|
|
|
-export default scrollPage;
|