Skip to content

Commit a2a52f9

Browse files
committed
update Example
1 parent be9f7de commit a2a52f9

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

Example/App.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
StyleSheet,
1414
Text,
1515
View,
16-
ScrollView
16+
ScrollView,
17+
Button
1718
} from 'react-native';
1819
import HuaWeiRefreshControl from './HuaWeiRefreshControl'
1920
const instructions = Platform.select({
@@ -49,6 +50,9 @@ export default class App extends Component<Props> {
4950
<Text style={styles.instructions}>
5051
{instructions}
5152
</Text>
53+
<Button title='beginRefresh' onPress={()=>{
54+
this._hw.beginRefresh()
55+
}}/>
5256
</View>
5357
</ScrollView>
5458
);

Example/HuaWeiRefreshControl.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ export default class HuaWeiRefreshControl extends Component {
5151
finishRefresh=()=>{
5252
this._mjrefresh && this._mjrefresh.finishRefresh();
5353
}
54+
beginRefresh=()=>{
55+
this._mjrefresh && this._mjrefresh.beginRefresh();
56+
}
5457
render() {
5558
return (
5659
<MJRefresh

Example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"react": "16.3.1",
1111
"react-native": "0.55.4",
1212
"react-native-indicators": "^0.13.0",
13-
"react-native-mjrefresh": "^0.1.0",
13+
"react-native-mjrefresh": "^0.2.0",
1414
"react-native-vector-icons": "^4.6.0"
1515
},
1616
"devDependencies": {

Example/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4170,9 +4170,9 @@ react-native-indicators@^0.13.0:
41704170
dependencies:
41714171
prop-types "^15.5.10"
41724172

4173-
react-native-mjrefresh@^0.1.0:
4174-
version "0.1.0"
4175-
resolved "https://registry.npmjs.org/react-native-mjrefresh/-/react-native-mjrefresh-0.1.0.tgz#eb82538aea440fa93bf6ff2d2bf2369a34dfc779"
4173+
react-native-mjrefresh@^0.2.0:
4174+
version "0.2.0"
4175+
resolved "https://registry.npmjs.org/react-native-mjrefresh/-/react-native-mjrefresh-0.2.0.tgz#4912c6f8a9d5dc68ec391ec9a8c1480f741a1c25"
41764176

41774177
react-native-vector-icons@^4.6.0:
41784178
version "4.6.0"

0 commit comments

Comments
 (0)