[ReactNative] Add warning when using onScroll without throttleScrollCallbackMS

This commit is contained in:
Christopher Chedeau
2015-02-11 18:26:03 -08:00
parent 5aa5e7a875
commit dd78b09741
3 changed files with 37 additions and 16 deletions

View File

@@ -20,22 +20,28 @@ exports.examples = [
title: '<ScrollView>',
description: 'To make content scrollable, wrap it within a <ScrollView> component',
render: function() {
return <ScrollView
return (
<ScrollView
onScroll={() => { console.log('onScroll!'); }}
throttleScrollCallbackMS={200}
contentInset={{top: -50}}
style={styles.scrollView}>
{THUMBS.map(createThumbRow)}
</ScrollView>;
</ScrollView>
);
}
}, {
title: '<ScrollView> (horizontal = true)',
description: 'You can display <ScrollView>\'s child components horizontally rather than vertically',
render: function() {
return <ScrollView
return (
<ScrollView
horizontal={true}
contentInset={{top: -50}}
style={[styles.scrollView, styles.horizontalScrollView]}>
{THUMBS.map(createThumbRow)}
</ScrollView>;
</ScrollView>
);
}
}];