mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-02 09:08:58 +08:00
Updates from Mon 23 Mar
- [React Native] Fix iOS 7 crashes b/c missing Photos.fmwk | Alex Akers - UIExplorer flowification | Basil Hosmer - Add clearImmediate module | Marshall Roch - [ReactNative] Print directories packager is serving files from | Alex Kotliarskyi - Work around flow bug with exports | Marshall Roch - [ReactNative] Move packager/init.sh to GitHub | Alex Kotliarskyi - [ReactNative] Remove react-native/package.json | Christopher Chedeau - [ReactNative] Returning actual contentSize for RCTScrollViewManager | Henry Lung
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/**
|
||||
* Copyright 2004-present Facebook. All Rights Reserved.
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -28,6 +29,8 @@ var ListViewSimpleExample = React.createClass({
|
||||
};
|
||||
},
|
||||
|
||||
_pressData: ({}: {[key: number]: boolean}),
|
||||
|
||||
componentWillMount: function() {
|
||||
this._pressData = {};
|
||||
},
|
||||
@@ -46,7 +49,7 @@ var ListViewSimpleExample = React.createClass({
|
||||
);
|
||||
},
|
||||
|
||||
_renderRow: function(rowData, sectionID, rowID) {
|
||||
_renderRow: function(rowData: string, sectionID: number, rowID: number) {
|
||||
var rowHash = Math.abs(hashCode(rowData));
|
||||
var imgSource = {
|
||||
uri: THUMB_URLS[rowHash % THUMB_URLS.length],
|
||||
@@ -66,7 +69,7 @@ var ListViewSimpleExample = React.createClass({
|
||||
);
|
||||
},
|
||||
|
||||
_genRows: function(pressData) {
|
||||
_genRows: function(pressData: {[key: number]: boolean}): Array<string> {
|
||||
var dataBlob = [];
|
||||
for (var ii = 0; ii < 100; ii++) {
|
||||
var pressedText = pressData[ii] ? ' (pressed)' : '';
|
||||
@@ -75,7 +78,7 @@ var ListViewSimpleExample = React.createClass({
|
||||
return dataBlob;
|
||||
},
|
||||
|
||||
_pressRow: function(rowID) {
|
||||
_pressRow: function(rowID: number) {
|
||||
this._pressData[rowID] = !this._pressData[rowID];
|
||||
this.setState({dataSource: this.state.dataSource.cloneWithRows(
|
||||
this._genRows(this._pressData)
|
||||
|
||||
Reference in New Issue
Block a user