【发布时间】:2018-11-16 23:18:22
【问题描述】:
我正在尝试在标头中调用参数化函数,但由于无法找到传递参数的方法而无法调用。
class MyScreen extends React.Component {
static navigationOptions = ({ navigation }) =>
{
headerLeft: (
<SearchBar
placeholder="Search"
round
onChangeText={text => this.searchFunction(text)}
/>
)
};
*searchFunction(text)
{
alert( text + ' searched succesfully');
}*
componentDidMount()
{
**//I would need implementation here**
}
render()
{
return (<View />);
}
}
【问题讨论】:
标签: android react-native react-native-android react-navigation react-native-ios