Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can a refresh be triggered with code? #8

Open
syousif94 opened this issue Jun 19, 2015 · 3 comments
Open

Can a refresh be triggered with code? #8

syousif94 opened this issue Jun 19, 2015 · 3 comments

Comments

@syousif94
Copy link

I'd like my list view to refresh on initial render to update stale cache. Is that possible?

@Shuangzuan
Copy link
Owner

Yes.

Sent from my iPhone

On Jun 19, 2015, at 5:45 PM, Sammy [email protected] wrote:

I'd like my list view to refresh on initial render to update stale cache. Is that possible?


Reply to this email directly or view it on GitHub.

@syousif94
Copy link
Author

I tried

var nodeHandle = React.findNodeHandle(this.refs.list);
NativeRCTRefreshControl.beginRefreshing(nodeHandle);

but it didn't work. Can you help me out?

@gpbl
Copy link

gpbl commented Oct 10, 2015

@syousif94 could you get it working? beginRefreshing is not exported in js, so you need first to change the source adding to RCTRefreshControl.ios.js:

  beginRefreshing: function(node) {
    var nodeHandle = React.findNodeHandle(node);
    RefreshControl.beginRefreshing(nodeHandle);
  }

this way you can make the RefreshControl appear behind the ScrollView. Now, the problem is how to make the ScrollView showing it without manual scrolling. I tried to scrollTo the ScrollView, but it didn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants