###わからないこと
ReactNativeの公式サイトのListViewのサンプルの処理で理解できない点があります。
下記コードの★の部分について
ListViewのrenderRowプロパティに格納されている即時関数の引数(rowData)はどこからきたのでしょうか?
JavaScript
1import React, { Component } from 'react'; 2import { AppRegistry, ListView, Text, View } from 'react-native'; 3 4class ListViewBasics extends Component { 5 6 constructor(props) { 7 super(props); 8 const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); 9 this.state = { 10 dataSource: ds.cloneWithRows([ 11 'John', 'Joel', 'James', 'Jimmy', 'Jackson', 'Jillian', 'Julie', 'Devin' 12 ]) 13 }; 14 } 15 render() { 16 return ( 17 <View style={{flex: 1, paddingTop: 22}}> 18 <ListView 19 dataSource={this.state.dataSource} 20 //★ 21 renderRow={(rowData) => <Text>{rowData}</Text>} 22 /> 23 </View> 24 ); 25 } 26} 27 28// App registration and rendering 29AppRegistry.registerComponent('ListViewBasics', () => ListViewBasics);
初歩的な質問で恐縮です。
###参考
引用元) https://facebook.github.io/react-native/docs/using-a-listview.html
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。