我正在尝试进行这三次重新引用,但是只有一个正在工作。我不知道问题是什么。
onChangeText={(text) => {
this.props.searchEvent.refetch({ term: text })
this.props.searchUser.refetch({ name: text })
this.props.searchLocation.refetch({ location: text })
this.setState({ searchTerm: text })
}}
我通过使回调函数异步解决了这个问题。
onChangeText={async (text) => {
await this.props.searchUser.refetch({ name: text })
await this.props.searchEvent.refetch({ term: text })
await this.setState({ searchTerm: text })
await this.props.searchLocation.refetch({ location: text })
}}