我是本机react的新手。我正在尝试推送到另一个页面。但我收到错误说
Undefined is not a function(evaluating '_this2._goToProductListing('app.productListing'{title:item.title})')
我的代码是这样的
_renderContent(section, i, isActive) {
return (
<View>
<List>
{section.content.map((item, i) => {
return(
<ListItem containerStyle={styles.categoryLists}
onPress={() => this._goToProductListing('app.productListing',{title:item.title})}
key={i} title={item.title}
/>
);
})}
</List>
</View>
);
}
//Send to product list page
_goToProductListing = (screen,data) => {
this.props.navigator.push({
screen: screen,
title: data.title,
passProps: {
data: data
}
});
};
render() {
return (
<View style={stylesheet.accrodianWraper}>
<ScrollView>
<Accordion
activeSection={this.state.activeSection}
sections={CONTENT}
touchableComponent={TouchableOpacity}
renderHeader={this._renderHeader}
renderContent={this._renderContent}
duration={0}
onChange={this._setSection.bind(this)}
/>
</ScrollView>
</View>
)
}
谁能告诉我我哪里做错了??我该如何解决?
对于我正在使用的导航wix react native navigation
,该页面app.productListing
也在 index.js 中注册。我正在使用 react-native-collapsible 来制作手风琴,B