尝试重置搜索输入字段,但setState无法正常工作
我已经尝试了几个堆栈溢出响应,但我非常确定我遗漏了一些非常小的东西。只是不确定是什么
我有一个驻留在App.js中的状态: searchInput,我将它传递给搜索字段,并将其传递给搜索输入组件,如下所示:
SearchInputComponent.js
// the Search and SearchInput are styled components so basically div and an input
<Search>
<SearchInput
type="text"
我在一个项目中使用podio-js包来处理我们的发票。我当前在尝试更新项目的类别类型字段时遇到问题。
下面是我目前运行的代码:
const url = `/item/${item_id}/value/${field_id}`;
// newOptionId is the id of the option I want to switch to
const requestData = JSON.stringify({[field_id]: newOptionId});
const responseData = await this.podio.request('PUT',