{"action":"created","issue":{"url":"https://api.github.com/repos/bolan9999/react-native-largelist/issues/129","repository_url":"https://api.github.com/repos/bolan9999/react-native-largelist","labels_url":"https://api.github.com/repos/bolan9999/react-native-largelist/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/bolan9999/react-native-largelist/issues/129/comments","events_url":"https://api.github.com/repos/bolan9999/react-native-largelist/issues/129/events","html_url":"https://github.com/bolan9999/react-native-largelist/issues/129","id":316237612,"number":129,"title":"Support Animated.event in onScroll prop with useNativeDriver: true","user":{"login":"collinglass","id":3614712,"avatar_url":"https://avatars3.githubusercontent.com/u/3614712?v=4","gravatar_id":"","url":"https://api.github.com/users/collinglass","html_url":"https://github.com/collinglass","followers_url":"https://api.github.com/users/collinglass/followers","following_url":"https://api.github.com/users/collinglass/following{/other_user}","gists_url":"https://api.github.com/users/collinglass/gists{/gist_id}","starred_url":"https://api.github.com/users/collinglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collinglass/subscriptions","organizations_url":"https://api.github.com/users/collinglass/orgs","repos_url":"https://api.github.com/users/collinglass/repos","events_url":"https://api.github.com/users/collinglass/events{/privacy}","received_events_url":"https://api.github.com/users/collinglass/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-20T11:53:03Z","updated_at":"2018-04-24T14:37:59Z","closed_at":null,"author_association":"NONE","body":"Hi there, thanks a lot for this library it is helping us a lot.\r\n\r\nThis is a request to support the Animated.event in onScroll.\r\n\r\nCurrently the way I understand your prop onScroll works is I am put a function like so: \r\n\r\n```\r\n        onScroll={({ nativeEvent: { contentOffset: { y } } }) => {\r\n            this.setState({ contentOffset: y })\r\n        }}\r\n```\r\nBecause the on scroll prop is fired so many times, this does not create a smooth experience and react native docs suggest to use an animated prop with the native driver to update state properties without triggering a re-render.\r\n\r\nthe updated syntax is like so: \r\n\r\n```\r\n        onScroll={Animated.event(\r\n          [\r\n            {\r\n              nativeEvent: { contentOffset: { y: this.state.scrollY } }\r\n            }\r\n          ],\r\n          { useNativeDriver: true } as Animated.EventConfig\r\n        )}\r\n```\r\n\r\nReact native docs on the subject: https://facebook.github.io/react-native/docs/animated.html\r\n\r\nPlease let me know what you think and if you have plans to support this. Thanks again\r\n\r\nEDIT: After playing around with this a little bit more I realize that it works when useNativeDriver is set to false. I updated the title accordingly. "},"comment":{"url":"https://api.github.com/repos/bolan9999/react-native-largelist/issues/comments/383956748","html_url":"https://github.com/bolan9999/react-native-largelist/issues/129#issuecomment-383956748","issue_url":"https://api.github.com/repos/bolan9999/react-native-largelist/issues/129","id":383956748,"user":{"login":"bolan9999","id":14797923,"avatar_url":"https://avatars2.githubusercontent.com/u/14797923?v=4","gravatar_id":"","url":"https://api.github.com/users/bolan9999","html_url":"https://github.com/bolan9999","followers_url":"https://api.github.com/users/bolan9999/followers","following_url":"https://api.github.com/users/bolan9999/following{/other_user}","gists_url":"https://api.github.com/users/bolan9999/gists{/gist_id}","starred_url":"https://api.github.com/users/bolan9999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolan9999/subscriptions","organizations_url":"https://api.github.com/users/bolan9999/orgs","repos_url":"https://api.github.com/users/bolan9999/repos","events_url":"https://api.github.com/users/bolan9999/events{/privacy}","received_events_url":"https://api.github.com/users/bolan9999/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T14:37:59Z","updated_at":"2018-04-24T14:37:59Z","author_association":"OWNER","body":"Sorry, not support right now."}}
{"actor":{"display_login":"bolan9999"}}