如何解决Context.Privider无法更新反应
我已经创建了一个上下文,并且值是一个具有有限数量属性的对象。
<Context.Provider value={contextValue}>
<div>
<input type="text" placeholder="Rechercher un plat" value={search} onChange={updateSearch} />
<ul>
{filteredOrder.map((order,i) => {
return <SelectOrder key={i} index={i} />;
})}
</ul>
</div>
</Context.Provider>
```
Here is my component for update or delete quantity. But it work only with my hooks. It doesn't work for updating the context value.
I want to past a object in value of context avec update this context in an other component where I have 2 button. One for add and an other for delete quantity
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。