0
SectionHeader에서 ref에 액세스하는 데 어려움을 겪고 있습니다. 문자열 대신 콜백 함수로 ref를 사용해야한다는 것을 이해하지만이를 구현하는 방법을 이해하지 못합니다.ListView - ReactNative를 사용하여 콜백 참조를 사용하는 방법
render(){
return (
<ListView
ref="mylist"
dataSource={this.state.dataSource}
renderRow={this.renderCampaign}
style={styles.listView}
renderSectionHeader={this.header.bind(this)}
onChangeVisibleRows={this.updateFocus.bind(this)}/>
);
}
}
header(data){
return(
<MapView
ref="mymap"
style={styles.map}
region={this.state.region}
onRegionChange={this.onRegionChange.bind(this)}
showsUserLocation={true}
>
{this.state.markers.map(marker => (
<MapView.Marker
coordinate={marker.coordinate}
title={marker.name}
description={marker.reward_type}
/>
))}
</MapView>
);
}
누군가 도움을 줄 수 있습니까?
도움과 빠른 답장을 보내 주셔서 감사합니다. :) – ArthurBK