mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Prettier the rest of ReactNative
Reviewed By: yungsters Differential Revision: D7974340 fbshipit-source-id: 5fe457a8a9be4bd360fc3af9acb5c1136b2be0d7
This commit is contained in:
committed by
Facebook Github Bot
parent
aba4ec0c09
commit
36fcbaa56d
@@ -4,6 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -47,15 +48,24 @@ var getInitialState = function() {
|
||||
};
|
||||
|
||||
var onScroll = function(e) {
|
||||
ScrollListener.onScroll(e.nativeEvent.contentOffset.x, e.nativeEvent.contentOffset.y);
|
||||
ScrollListener.onScroll(
|
||||
e.nativeEvent.contentOffset.x,
|
||||
e.nativeEvent.contentOffset.y,
|
||||
);
|
||||
};
|
||||
|
||||
var onScrollBeginDrag = function(e) {
|
||||
ScrollListener.onScrollBeginDrag(e.nativeEvent.contentOffset.x, e.nativeEvent.contentOffset.y);
|
||||
ScrollListener.onScrollBeginDrag(
|
||||
e.nativeEvent.contentOffset.x,
|
||||
e.nativeEvent.contentOffset.y,
|
||||
);
|
||||
};
|
||||
|
||||
var onScrollEndDrag = function(e) {
|
||||
ScrollListener.onScrollEndDrag(e.nativeEvent.contentOffset.x, e.nativeEvent.contentOffset.y);
|
||||
ScrollListener.onScrollEndDrag(
|
||||
e.nativeEvent.contentOffset.x,
|
||||
e.nativeEvent.contentOffset.y,
|
||||
);
|
||||
};
|
||||
|
||||
var onItemPress = function(itemNumber) {
|
||||
@@ -78,11 +88,17 @@ var ScrollViewTestApp = createReactClass({
|
||||
scrollViewApp = this;
|
||||
var children = this.state.data.map((item, index) => (
|
||||
<Item
|
||||
key={index} text={item.text}
|
||||
onPress={this.onItemPress.bind(this, index)} />
|
||||
key={index}
|
||||
text={item.text}
|
||||
onPress={this.onItemPress.bind(this, index)}
|
||||
/>
|
||||
));
|
||||
return (
|
||||
<ScrollView onScroll={this.onScroll} onScrollBeginDrag={this.onScrollBeginDrag} onScrollEndDrag={this.onScrollEndDrag} ref="scrollView">
|
||||
<ScrollView
|
||||
onScroll={this.onScroll}
|
||||
onScrollBeginDrag={this.onScrollBeginDrag}
|
||||
onScrollEndDrag={this.onScrollEndDrag}
|
||||
ref="scrollView">
|
||||
{children}
|
||||
</ScrollView>
|
||||
);
|
||||
@@ -103,8 +119,10 @@ var HorizontalScrollViewTestApp = createReactClass({
|
||||
scrollViewApp = this;
|
||||
var children = this.state.data.map((item, index) => (
|
||||
<Item
|
||||
key={index} text={item.text}
|
||||
onPress={this.onItemPress.bind(this, index)} />
|
||||
key={index}
|
||||
text={item.text}
|
||||
onPress={this.onItemPress.bind(this, index)}
|
||||
/>
|
||||
));
|
||||
return (
|
||||
<ScrollView horizontal={true} onScroll={this.onScroll} ref="scrollView">
|
||||
@@ -136,7 +154,7 @@ var ScrollViewTestModule = {
|
||||
|
||||
BatchedBridge.registerCallableModule(
|
||||
'ScrollViewTestModule',
|
||||
ScrollViewTestModule
|
||||
ScrollViewTestModule,
|
||||
);
|
||||
|
||||
module.exports = ScrollViewTestModule;
|
||||
|
||||
Reference in New Issue
Block a user