我将通过ref更改textinput,但是什么也没发生
我在渲染器中的代码如下
<TextInput
onChangeText={(value) => this.setState({replyTicketText: value})} />
ref={"replyInput"+this.state.ticketID}
/>
当我调用函数时:
let replyInput;
replyInput = "replyInput"+this.state.ticketID;
this.refs[replyInput].setNativeProps({ text: ' ' });
platfrom:iOS
答案 0 :(得分:1)
我可能会误会,但是将输入挂接到状态不是更容易,状态更改时字段会更新吗?
value = {this.state.replyTicketText}