【发布时间】:2019-04-20 23:57:22
【问题描述】:
我试试这个
<Input placeholder="search...."
ref={(ref) => { this.SearchInput = ref; }}
/>
<Button transparent onPress={this.clear}>
<Ionicons name="ios-close" />
</Button>
和功能:
clear = () => {
this.SearchInput.clear();
}
我收到此错误:
this.SearchInput.clear() 不是函数
【问题讨论】:
-
它适用于 TextInput 但不适用于 Input Native-base
-
您没有使用 State 或 Redux 或任何状态管理器来控制您的文本输入?
标签: react-native native-base react-native-textinput