기본 콘텐츠로 건너뛰기

react-native bind and listview item event handler

In ListView bind.this and renderRow() also bind.this


return (
    <ListView        dataSource={this.state.dataSource}
        renderRow={this.renderItem.bind(this)}
        style={styles.listView}
    />
);



renderProgram(program) {
    return (
            <TouchableHighlight                onPress={this.handlePress.bind(this, ...)}>
                <View style={styles.row}>
                 ...
                </View>
            </TouchableHighlight>
    );
}

댓글

이 블로그의 인기 게시물