反应完整日历拖动保存到状态

React full calendar dragging save to state

你好,我在完整日历中使用了拖动,我将事件保存在一个状态中,但它在前端复制了事件,请参见此处的示例:https://codesandbox.io/s/fullcalendar-dragging-6js74

如何在不复制的情况下将事件存储在状态中,

我认为它显示一个来自州,一个来自日历本身,但我只需要显示状态一,因为我还存储了点击添加的事件和 select 相同的状态。

有什么解决办法吗?

你说得对,从状态中添加一个事件,从删除操作中添加一个事件。

我的建议是在将 eventReceive callback instead of the "drop" callback. In eventReceive you get you direct access to the event object added to the calendar - that way you can then delete that event (using the event's remove method 添加到状态后处理它。