{"id":4017,"url":"https://github.com/syrusakbary/react-native-refresher","last_synced_at":"2025-04-05T13:09:57.283Z","repository":{"id":34695351,"uuid":"38670515","full_name":"syrusakbary/react-native-refresher","owner":"syrusakbary","description":"A pull to refresh ListView for React Native completely written in js.","archived":false,"fork":false,"pushed_at":"2016-08-02T03:33:03.000Z","size":135,"stargazers_count":450,"open_issues_count":12,"forks_count":34,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-29T12:08:33.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syrusakbary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-07T07:13:30.000Z","updated_at":"2025-02-11T21:31:57.000Z","dependencies_parsed_at":"2022-08-28T11:11:46.235Z","dependency_job_id":null,"html_url":"https://github.com/syrusakbary/react-native-refresher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syrusakbary%2Freact-native-refresher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syrusakbary%2Freact-native-refresher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syrusakbary%2Freact-native-refresher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syrusakbary%2Freact-native-refresher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syrusakbary","download_url":"https://codeload.github.com/syrusakbary/react-native-refresher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:58.580Z","updated_at":"2025-04-05T13:09:57.260Z","avatar_url":"https://github.com/syrusakbary.png","language":"JavaScript","funding_links":[],"categories":["Components","JavaScript","组件","Libraries","Others"],"sub_categories":["UI","ListView\u0026ScrollView"],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/syrusakbary/react-native-refresher/master/logo.png\" width=\"300\"/\u003e\n\nA pull to refresh ListView for React Native completely written in js.\nAlso supports custom animations.\n\n## Installation\n\n```sh\nnpm install react-native-refresher --save\n```\n\n## Usage\n\n```js\nvar React = require('react-native');\n// Loading the refresher ListView and Indicator\nvar {\n  RefresherListView,\n  LoadingBarIndicator\n} = require('react-native-refresher');\n\nvar {\n  AppRegistry,\n  Text,\n  View,\n  ListView,\n} = React;\n\n\nclass Content extends React.Component {\n  constructor() {\n    super();\n    this.ds = new ListView.DataSource({rowHasChanged: (r1, r2) =\u003e r1 !== r2});\n    this.state = {\n      dataSource: this.ds.cloneWithRows([\"Row 1\", \"Row 2\"]),\n    };\n  }\n  onRefresh() {\n  \t// You can either return a promise or a callback\n    this.setState({dataSource:this.fillRows([\"Row 1\", \"Row 2\", \"Row 3\", \"Row 4\"])});\n  }\n  render() {\n    return (\n      \u003cView style={{flex:1}}\u003e\n        \u003cRefresherListView\n          dataSource={this.state.dataSource}\n          onRefresh={this.onRefresh.bind(this)}\n          indicator={\u003cLoadingBarIndicator /\u003e}\n          renderRow={(rowData) =\u003e \u003cView style={{padding:10,borderBottomColor: '#CCCCCC', backgroundColor: 'white',borderBottomWidth: 1}}\u003e\u003cText\u003e{rowData}\u003c/Text\u003e\u003c/View\u003e}\n        /\u003e\n      \u003c/View\u003e\n    );\n  }\n};\n\n```\n\n## Examples\n\n![Refresher: iOS Activity Indicator](https://raw.githubusercontent.com/syrusakbary/react-native-refresher/master/screencasts/activity-indicator-fixed.gif)\n![Refresher: Bar Indicator](https://raw.githubusercontent.com/syrusakbary/react-native-refresher/master/screencasts/bar-indicator-top.gif)\n\n\n#### Props\n\n- `threshold: number`\n  The amount of pixeles to validate the refresh.\n  By default the theshold will be calculated by the header height.\n- `minTime: number`\n  The minimum amount of time for showing the loading indicator while is refreshing. Default 320ms.\n- `onRefresh: func.isRequired`\n  Called when user pulls listview down to refresh.\n- `indicator: oneOfType([element])`\n  React Element. See [example of a custom indicator](https://github.com/syrusakbary/react-native-refresher/blob/master/examples/CustomIndicator/indicator.js)\n- `refreshOnRelease: bool`\n  If is necessary to release touch for refresh or refresh will be done automatically once threshold is passed.\n- `listStyle: style`\n  The list style\n\n\n# Credits\n\nRefresher is created by [Syrus Akbary](https://www.syrusakbary.com) and inspired by [Refresher](https://github.com/jcavar/refresher) and [react-native-refreshable-listview](https://github.com/jsdf/react-native-refreshable-listview).\nIf you have suggestions or bug reports, feel free to send pull request or [create new issue](https://github.com/syrusakbary/react-native-pullrefresh-listview/issues/new).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyrusakbary%2Freact-native-refresher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyrusakbary%2Freact-native-refresher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyrusakbary%2Freact-native-refresher/lists"}