Home  >  Article  >  Web Front-end  >  Implementation method of click jump of ListView component in react-native

Implementation method of click jump of ListView component in react-native

小云云
小云云Original
2018-01-30 17:43:251900browse

This article mainly introduces you to the relevant information about the click jump of the ListView component in react-native. ListView, as the core component of React Native, is used to efficiently display a changing data list that can be scrolled vertically. Friends in need can refer to it, let’s take a look below.

Look at the effect first

##Usage


NewsList.js

_onPress(rowData) {
 this.props.navigator.push({
 title: rowData,
 component: CNodeJSList,
 passProps: {
 name: rowData,
 }
 })
}
Instructions

  • Use this.props.navigator.push() to specify the component to jump to the next view. If you want to pass a value, you can use the passProps attribute and use this in the next view. Just receive props.name

  • For the invocation of the method in onPress, if the _onPress method is called with onPress={this._onPress}, the page will not jump and needs to be bound. To determine this, the writing method is: onPress={this._onPress.bind(this)} But it seems that the value cannot be passed, so to pass the value, you need to write like this: onPress={()=>{this._onPress(rowData)} } , so there is no problem, and the page can be jumped successfully.

Related recommendations:

JS implementation of div click to jump to another page example code

WeChat small How to prevent program function throttling from multiple click jumps

Example detailed explanation JS simple method to implement click jump login email function

The above is the detailed content of Implementation method of click jump of ListView component in react-native. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn